const char *color_pids_str;
struct cpu_map *color_cpus;
const char *color_cpus_str;
+ struct cpu_map *cpus;
+ const char *cpus_str;
};
struct perf_sched {
if (curr_thread && thread__has_color(curr_thread))
pid_color = COLOR_PIDS;
+ if (sched->map.cpus && !cpu_map__has(sched->map.cpus, cpu))
+ continue;
+
if (sched->map.color_cpus && cpu_map__has(sched->map.color_cpus, cpu))
cpu_color = COLOR_CPUS;
color_fprintf(stdout, color, " ");
}
+ if (sched->map.cpus && !cpu_map__has(sched->map.cpus, this_cpu))
+ goto out;
+
color_fprintf(stdout, color, " %12.6f secs ", (double)timestamp/1e9);
if (new_shortname) {
const char *pid_color = color;
if (sched->map.comp && new_cpu)
color_fprintf(stdout, color, " (CPU %d)", this_cpu);
+out:
color_fprintf(stdout, color, "\n");
thread__put(sched_in);
static int setup_map_cpus(struct perf_sched *sched)
{
+ struct cpu_map *map;
+
sched->max_cpu = sysconf(_SC_NPROCESSORS_CONF);
if (sched->map.comp) {
return -1;
}
+ if (!sched->map.cpus_str)
+ return 0;
+
+ map = cpu_map__new(sched->map.cpus_str);
+ if (!map) {
+ pr_err("failed to get cpus map from %s\n", sched->map.cpus_str);
+ return -1;
+ }
+
+ sched->map.cpus = map;
return 0;
}
"highlight given pids in map"),
OPT_STRING(0, "color-cpus", &sched.map.color_cpus_str, "cpus",
"highlight given CPUs in map"),
+ OPT_STRING(0, "cpus", &sched.map.cpus_str, "cpus",
+ "display given CPUs in map"),
OPT_END()
};
const char * const latency_usage[] = {