zoukankan      html  css  js  c++  java
  • ltp-ddt nand_perf_ubifs_w_cpuload

    NAND_M_PERF_UBIFS_CPU_LOAD source 'common.sh';/opt/ltp/runltp -f ddt/nand_perf_ubifs -s "NAND_S_PERF_UBIFS " -P $PLATFORM -c 8
     
    runltp -c
     
    in runltp:
     
    do  case $arg in
        c)       
                NUM_PROCS=$(($OPTARG))
                if   [ "$NUM_PROCS" -eq 0 ]; then
                    # User Did not Define the Value ,or, User Defined Zero,
                    # hence, prevent from creating infinite processes
                    NUM_PROCS=1
                fi
                $LTPROOT/testcases/bin/genload --cpu $NUM_PROCS >/dev/null 2>&1 &
                GENLOAD=1 ;;
     
     
    genload --cpu $NUM_PROCS >/dev/null 2>&1 &
     
    -c, --cpu n           spawn n procs spinning on sqrt() "
    genload in ltp-ddt-backup-servergit oolsgenload
     
    ->main
    else if (strcmp(arg, "--cpu") == 0 || strcmp(arg, "-c") == 0) {
                do_cpu = 1;
                assert_arg("--cpu");
                do_cpu_forks = atoll_b(arg);
     
    /* Hog CPU option.  */
        if (do_cpu) {
            out(stdout, "dispatching %lli hogcpu forks ", do_cpu_forks);

            switch (pid = fork()) {
            case 0:    /* child */
                if (do_dryrun)
                    exit(0);
                exit(hogcpu(do_cpu_forks));
            case -1:    /* error */
                err(stderr, "hogcpu dispatcher fork failed ");
                exit(1);
            default:    /* parent */
                children++;
                dbg(stdout, "--> hogcpu dispatcher forked (%i) ", pid);
            }
        }
     
    in hogcpu
     
    for (i = 0; forks == 0 || i < forks; i++) {
            switch (pid = fork()) {
            case 0:    /* child */
                alarm(timeout);

                /* Use a backoff sleep to ensure we get good fork throughput.  */
                usleep(backoff);

                while (1)
                    d = sqrt(rand());

                /* This case never falls through; alarm signal can cause exit.  */
            case -1:    /* error */
                if (ignore) {
                    ++retval;
                    wrn(stderr,
                        "hogcpu worker fork failed, continuing ");
                    usleep(retry);
                    continue;
                }

                err(stderr, "hogcpu worker fork failed ");
                return 1;
            default:    /* parent */
                dbg(stdout, "--> hogcpu worker forked (%i) ", pid);
            }
        }
     
     
     
     
     
     
     
  • 相关阅读:
    SpringBoot+SpringCloud
    bootstrap-thymeleaf-分页
    排序-Java
    native2ascii运用
    标准W3C盒子模型和IE盒子模型
    在既定状态下截图
    java.util.zip.ZipException: error in opening zip file
    安装 haproxy
    mysql集群
    最简redis集群配置
  • 原文地址:https://www.cnblogs.com/idyllcheung/p/10950864.html
Copyright © 2011-2022 走看看