提交 41cb6654 编写于 作者: L Linus Torvalds

Merge branch 'perf-fixes-for-linus' of...

Merge branch 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

* 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  perf tools: Run generate-cmdlist.sh properly
  perf_event: Clean up perf_event_init_task()
  perf_event: Fix event group handling in __perf_event_sched_*()
  perf timechart: Add a power-only mode
  perf top: Add poll_idle to the skip list
...@@ -1030,14 +1030,10 @@ void __perf_event_sched_out(struct perf_event_context *ctx, ...@@ -1030,14 +1030,10 @@ void __perf_event_sched_out(struct perf_event_context *ctx,
update_context_time(ctx); update_context_time(ctx);
perf_disable(); perf_disable();
if (ctx->nr_active) { if (ctx->nr_active)
list_for_each_entry(event, &ctx->group_list, group_entry) { list_for_each_entry(event, &ctx->group_list, group_entry)
if (event != event->group_leader) group_sched_out(event, cpuctx, ctx);
event_sched_out(event, cpuctx, ctx);
else
group_sched_out(event, cpuctx, ctx);
}
}
perf_enable(); perf_enable();
out: out:
spin_unlock(&ctx->lock); spin_unlock(&ctx->lock);
...@@ -1258,12 +1254,8 @@ __perf_event_sched_in(struct perf_event_context *ctx, ...@@ -1258,12 +1254,8 @@ __perf_event_sched_in(struct perf_event_context *ctx,
if (event->cpu != -1 && event->cpu != cpu) if (event->cpu != -1 && event->cpu != cpu)
continue; continue;
if (event != event->group_leader) if (group_can_go_on(event, cpuctx, 1))
event_sched_in(event, cpuctx, ctx, cpu); group_sched_in(event, cpuctx, ctx, cpu);
else {
if (group_can_go_on(event, cpuctx, 1))
group_sched_in(event, cpuctx, ctx, cpu);
}
/* /*
* If this pinned group hasn't been scheduled, * If this pinned group hasn't been scheduled,
...@@ -1291,15 +1283,9 @@ __perf_event_sched_in(struct perf_event_context *ctx, ...@@ -1291,15 +1283,9 @@ __perf_event_sched_in(struct perf_event_context *ctx,
if (event->cpu != -1 && event->cpu != cpu) if (event->cpu != -1 && event->cpu != cpu)
continue; continue;
if (event != event->group_leader) { if (group_can_go_on(event, cpuctx, can_add_hw))
if (event_sched_in(event, cpuctx, ctx, cpu)) if (group_sched_in(event, cpuctx, ctx, cpu))
can_add_hw = 0; can_add_hw = 0;
} else {
if (group_can_go_on(event, cpuctx, can_add_hw)) {
if (group_sched_in(event, cpuctx, ctx, cpu))
can_add_hw = 0;
}
}
} }
perf_enable(); perf_enable();
out: out:
...@@ -4781,9 +4767,7 @@ int perf_event_init_task(struct task_struct *child) ...@@ -4781,9 +4767,7 @@ int perf_event_init_task(struct task_struct *child)
* We dont have to disable NMIs - we are only looking at * We dont have to disable NMIs - we are only looking at
* the list, not manipulating it: * the list, not manipulating it:
*/ */
list_for_each_entry_rcu(event, &parent_ctx->event_list, event_entry) { list_for_each_entry(event, &parent_ctx->group_list, group_entry) {
if (event != event->group_leader)
continue;
if (!event->attr.inherit) { if (!event->attr.inherit) {
inherited_all = 0; inherited_all = 0;
......
...@@ -31,6 +31,9 @@ OPTIONS ...@@ -31,6 +31,9 @@ OPTIONS
-w:: -w::
--width=:: --width=::
Select the width of the SVG file (default: 1000) Select the width of the SVG file (default: 1000)
-p::
--power-only::
Only output the CPU power section of the diagram
SEE ALSO SEE ALSO
......
...@@ -728,7 +728,7 @@ $(BUILT_INS): perf$X ...@@ -728,7 +728,7 @@ $(BUILT_INS): perf$X
common-cmds.h: util/generate-cmdlist.sh command-list.txt common-cmds.h: util/generate-cmdlist.sh command-list.txt
common-cmds.h: $(wildcard Documentation/perf-*.txt) common-cmds.h: $(wildcard Documentation/perf-*.txt)
$(QUIET_GEN)util/generate-cmdlist.sh > $@+ && mv $@+ $@ $(QUIET_GEN). util/generate-cmdlist.sh > $@+ && mv $@+ $@
$(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh
$(QUIET_GEN)$(RM) $@ $@+ && \ $(QUIET_GEN)$(RM) $@ $@+ && \
......
...@@ -46,6 +46,8 @@ static u64 turbo_frequency; ...@@ -46,6 +46,8 @@ static u64 turbo_frequency;
static u64 first_time, last_time; static u64 first_time, last_time;
static int power_only;
static struct perf_header *header; static struct perf_header *header;
...@@ -547,7 +549,7 @@ static void end_sample_processing(void) ...@@ -547,7 +549,7 @@ static void end_sample_processing(void)
u64 cpu; u64 cpu;
struct power_event *pwr; struct power_event *pwr;
for (cpu = 0; cpu < numcpus; cpu++) { for (cpu = 0; cpu <= numcpus; cpu++) {
pwr = malloc(sizeof(struct power_event)); pwr = malloc(sizeof(struct power_event));
if (!pwr) if (!pwr)
return; return;
...@@ -871,7 +873,7 @@ static int determine_display_tasks(u64 threshold) ...@@ -871,7 +873,7 @@ static int determine_display_tasks(u64 threshold)
/* no exit marker, task kept running to the end */ /* no exit marker, task kept running to the end */
if (p->end_time == 0) if (p->end_time == 0)
p->end_time = last_time; p->end_time = last_time;
if (p->total_time >= threshold) if (p->total_time >= threshold && !power_only)
p->display = 1; p->display = 1;
c = p->all; c = p->all;
...@@ -882,7 +884,7 @@ static int determine_display_tasks(u64 threshold) ...@@ -882,7 +884,7 @@ static int determine_display_tasks(u64 threshold)
if (c->start_time == 1) if (c->start_time == 1)
c->start_time = first_time; c->start_time = first_time;
if (c->total_time >= threshold) { if (c->total_time >= threshold && !power_only) {
c->display = 1; c->display = 1;
count++; count++;
} }
...@@ -1134,6 +1136,8 @@ static const struct option options[] = { ...@@ -1134,6 +1136,8 @@ static const struct option options[] = {
"output file name"), "output file name"),
OPT_INTEGER('w', "width", &svg_page_width, OPT_INTEGER('w', "width", &svg_page_width,
"page width"), "page width"),
OPT_BOOLEAN('p', "power-only", &power_only,
"output power data only"),
OPT_END() OPT_END()
}; };
......
...@@ -782,6 +782,7 @@ static const char *skip_symbols[] = { ...@@ -782,6 +782,7 @@ static const char *skip_symbols[] = {
"exit_idle", "exit_idle",
"mwait_idle", "mwait_idle",
"mwait_idle_with_hints", "mwait_idle_with_hints",
"poll_idle",
"ppc64_runlatch_off", "ppc64_runlatch_off",
"pseries_dedicated_idle_sleep", "pseries_dedicated_idle_sleep",
NULL NULL
......
...@@ -28,7 +28,7 @@ static u64 turbo_frequency, max_freq; ...@@ -28,7 +28,7 @@ static u64 turbo_frequency, max_freq;
int svg_page_width = 1000; int svg_page_width = 1000;
#define MIN_TEXT_SIZE 0.001 #define MIN_TEXT_SIZE 0.01
static u64 total_height; static u64 total_height;
static FILE *svgfile; static FILE *svgfile;
...@@ -217,6 +217,18 @@ static char *cpu_model(void) ...@@ -217,6 +217,18 @@ static char *cpu_model(void)
} }
fclose(file); fclose(file);
} }
/* CPU type */
file = fopen("/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies", "r");
if (file) {
while (fgets(buf, 255, file)) {
unsigned int freq;
freq = strtoull(buf, NULL, 10);
if (freq > max_freq)
max_freq = freq;
}
fclose(file);
}
return cpu_m; return cpu_m;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册