Changeset 3621 in MondoRescue for branches/3.3/mindi-busybox/procps/powertop.c


Ignore:
Timestamp:
Dec 20, 2016, 4:07:32 PM (7 years ago)
Author:
Bruno Cornec
Message:

New 3?3 banch for incorporation of latest busybox 1.25. Changing minor version to handle potential incompatibilities.

Location:
branches/3.3
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/3.3/mindi-busybox/procps/powertop.c

    r3232 r3621  
    361361
    362362        name = p;
    363         strchrnul(name, '\n')[0] = '\0';
     363        chomp(p);
    364364        /* Save description of the interrupt */
    365365        if (nr >= 20000)
     
    459459            //}
    460460
    461             if (strncmp(func, "tick_nohz_", 10) == 0)
    462                 continue;
    463             if (strncmp(func, "tick_setup_sched_timer", 20) == 0)
     461            if (is_prefixed_with(func, "tick_nohz_"))
     462                continue;
     463            if (is_prefixed_with(func, "tick_setup_sched_timer"))
    464464                continue;
    465465            //if (strcmp(process, "powertop") == 0)
     
    471471            }
    472472
    473             strchrnul(p, '\n')[0] = '\0';
     473            chomp(p);
    474474
    475475            // 46D\01136\0kondemand/1\0do_dbs_timer (delayed_work_timer_fn)
     
    592592        return;
    593593
    594     printf("Your CPU supports the following C-states: ");
     594    printf("Your %s the following C-states: ", "CPU supports");
    595595    i = 0;
    596596    while (edx) {
     
    603603
    604604    /* Print BIOS C-States */
    605     printf("Your BIOS reports the following C-states: ");
     605    printf("Your %s the following C-states: ", "BIOS reports");
    606606    for (i = 0; i < ARRAY_SIZE(bios_table); i++)
    607607        if (bios_table[i])
     
    628628        char strbuf6[6];
    629629
    630         strbuf6[5] = '\0';
    631630        puts("\nTop causes for wakeups:");
    632631        for (i = 0; i < G.lines_cnt; i++) {
     
    640639                if (G.lines[i].disk_count)
    641640                    c = 'D';*/
    642                 smart_ulltoa5(G.lines[i].count, strbuf6, " KMGTPEZY");
     641                smart_ulltoa5(G.lines[i].count, strbuf6, " KMGTPEZY")[0] = '\0';
    643642                printf(/*" %5.1f%% (%s)%c  %s\n"*/
    644643                    " %5.1f%% (%s)   %s\n",
     
    676675//usage:       ""
    677676//usage:#define powertop_full_usage "\n\n"
    678 //usage:       "Analyze power consumption on Intel-based laptops\n"
     677//usage:       "Analyze power consumption on Intel-based laptops"
    679678
    680679int powertop_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
     
    706705    G.total_cpus = get_cpu_count();
    707706
    708     printf("Collecting data for "DEFAULT_SLEEP_STR" seconds\n");
     707    puts("Collecting data for "DEFAULT_SLEEP_STR" seconds");
    709708
    710709#if ENABLE_FEATURE_USE_TERMIOS
Note: See TracChangeset for help on using the changeset viewer.