aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-06-05 08:29:10 -0400
committerIngo Molnar <mingo@elte.hu>2009-06-05 08:32:19 -0400
commit2debbc836696f2a815d02630230584a1754a5022 (patch)
treef04f2eca0ed514ab996cfbb29d69af1ea22481e1 /Documentation
parent8edd4286f99f78fe07fe9196e69d5643da86cada (diff)
perf_counter tools: Clarify events/samples naming
A number of places said 'events' while they should say 'samples'. Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> LKML-Reference: <new-submission> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/perf_counter/builtin-record.c22
-rw-r--r--Documentation/perf_counter/builtin-report.c2
-rw-r--r--Documentation/perf_counter/builtin-top.c46
3 files changed, 35 insertions, 35 deletions
diff --git a/Documentation/perf_counter/builtin-record.c b/Documentation/perf_counter/builtin-record.c
index e2301f39e551..d4ad3057a711 100644
--- a/Documentation/perf_counter/builtin-record.c
+++ b/Documentation/perf_counter/builtin-record.c
@@ -65,7 +65,7 @@ static unsigned int mmap_read_head(struct mmap_data *md)
65 return head; 65 return head;
66} 66}
67 67
68static long events; 68static long samples;
69static struct timeval last_read, this_read; 69static struct timeval last_read, this_read;
70 70
71static __u64 bytes_written; 71static __u64 bytes_written;
@@ -83,7 +83,7 @@ static void mmap_read(struct mmap_data *md)
83 83
84 /* 84 /*
85 * If we're further behind than half the buffer, there's a chance 85 * If we're further behind than half the buffer, there's a chance
86 * the writer will bite our tail and screw up the events under us. 86 * the writer will bite our tail and mess up the samples under us.
87 * 87 *
88 * If we somehow ended up ahead of the head, we got messed up. 88 * If we somehow ended up ahead of the head, we got messed up.
89 * 89 *
@@ -109,7 +109,7 @@ static void mmap_read(struct mmap_data *md)
109 last_read = this_read; 109 last_read = this_read;
110 110
111 if (old != head) 111 if (old != head)
112 events++; 112 samples++;
113 113
114 size = head - old; 114 size = head - old;
115 115
@@ -257,7 +257,7 @@ out_failure:
257 exit(EXIT_FAILURE); 257 exit(EXIT_FAILURE);
258} 258}
259 259
260static void pid_synthesize_mmap_events(pid_t pid) 260static void pid_synthesize_mmap_samples(pid_t pid)
261{ 261{
262 char filename[PATH_MAX]; 262 char filename[PATH_MAX];
263 FILE *fp; 263 FILE *fp;
@@ -315,7 +315,7 @@ static void pid_synthesize_mmap_events(pid_t pid)
315 fclose(fp); 315 fclose(fp);
316} 316}
317 317
318static void synthesize_events(void) 318static void synthesize_samples(void)
319{ 319{
320 DIR *proc; 320 DIR *proc;
321 struct dirent dirent, *next; 321 struct dirent dirent, *next;
@@ -331,7 +331,7 @@ static void synthesize_events(void)
331 continue; 331 continue;
332 332
333 pid_synthesize_comm_event(pid, 1); 333 pid_synthesize_comm_event(pid, 1);
334 pid_synthesize_mmap_events(pid); 334 pid_synthesize_mmap_samples(pid);
335 } 335 }
336 336
337 closedir(proc); 337 closedir(proc);
@@ -396,7 +396,7 @@ static void open_counters(int cpu, pid_t pid)
396 396
397 if (pid > 0) { 397 if (pid > 0) {
398 pid_synthesize_comm_event(pid, 0); 398 pid_synthesize_comm_event(pid, 0);
399 pid_synthesize_mmap_events(pid); 399 pid_synthesize_mmap_samples(pid);
400 } 400 }
401 401
402 group_fd = -1; 402 group_fd = -1;
@@ -469,17 +469,17 @@ static int __cmd_record(int argc, const char **argv)
469 } 469 }
470 470
471 if (system_wide) 471 if (system_wide)
472 synthesize_events(); 472 synthesize_samples();
473 473
474 while (!done) { 474 while (!done) {
475 int hits = events; 475 int hits = samples;
476 476
477 for (i = 0; i < nr_cpu; i++) { 477 for (i = 0; i < nr_cpu; i++) {
478 for (counter = 0; counter < nr_counters; counter++) 478 for (counter = 0; counter < nr_counters; counter++)
479 mmap_read(&mmap_array[i][counter]); 479 mmap_read(&mmap_array[i][counter]);
480 } 480 }
481 481
482 if (hits == events) 482 if (hits == samples)
483 ret = poll(event_array, nr_poll, 100); 483 ret = poll(event_array, nr_poll, 100);
484 } 484 }
485 485
@@ -487,7 +487,7 @@ static int __cmd_record(int argc, const char **argv)
487 * Approximate RIP event size: 24 bytes. 487 * Approximate RIP event size: 24 bytes.
488 */ 488 */
489 fprintf(stderr, 489 fprintf(stderr,
490 "[ perf record: Captured and wrote %.3f MB %s (~%lld events) ]\n", 490 "[ perf record: Captured and wrote %.3f MB %s (~%lld samples) ]\n",
491 (double)bytes_written / 1024.0 / 1024.0, 491 (double)bytes_written / 1024.0 / 1024.0,
492 output_name, 492 output_name,
493 bytes_written / 24); 493 bytes_written / 24);
diff --git a/Documentation/perf_counter/builtin-report.c b/Documentation/perf_counter/builtin-report.c
index ca303fd74a71..5af105c280b5 100644
--- a/Documentation/perf_counter/builtin-report.c
+++ b/Documentation/perf_counter/builtin-report.c
@@ -857,7 +857,7 @@ static size_t output__fprintf(FILE *fp, uint64_t total_samples)
857 857
858 fprintf(fp, "\n"); 858 fprintf(fp, "\n");
859 fprintf(fp, "#\n"); 859 fprintf(fp, "#\n");
860 fprintf(fp, "# (%Ld profiler events)\n", (__u64)total_samples); 860 fprintf(fp, "# (%Ld samples)\n", (__u64)total_samples);
861 fprintf(fp, "#\n"); 861 fprintf(fp, "#\n");
862 862
863 fprintf(fp, "# Overhead"); 863 fprintf(fp, "# Overhead");
diff --git a/Documentation/perf_counter/builtin-top.c b/Documentation/perf_counter/builtin-top.c
index 2fee5951b231..ff7e13c4647c 100644
--- a/Documentation/perf_counter/builtin-top.c
+++ b/Documentation/perf_counter/builtin-top.c
@@ -137,8 +137,8 @@ static double sym_weight(const struct sym_entry *sym)
137 return weight; 137 return weight;
138} 138}
139 139
140static long events; 140static long samples;
141static long userspace_events; 141static long userspace_samples;
142static const char CONSOLE_CLEAR[] = ""; 142static const char CONSOLE_CLEAR[] = "";
143 143
144static void __list_insert_active_sym(struct sym_entry *syme) 144static void __list_insert_active_sym(struct sym_entry *syme)
@@ -177,14 +177,14 @@ static void print_sym_table(void)
177{ 177{
178 int printed = 0, j; 178 int printed = 0, j;
179 int counter; 179 int counter;
180 float events_per_sec = events/delay_secs; 180 float samples_per_sec = samples/delay_secs;
181 float kevents_per_sec = (events-userspace_events)/delay_secs; 181 float ksamples_per_sec = (samples-userspace_samples)/delay_secs;
182 float sum_kevents = 0.0; 182 float sum_ksamples = 0.0;
183 struct sym_entry *syme, *n; 183 struct sym_entry *syme, *n;
184 struct rb_root tmp = RB_ROOT; 184 struct rb_root tmp = RB_ROOT;
185 struct rb_node *nd; 185 struct rb_node *nd;
186 186
187 events = userspace_events = 0; 187 samples = userspace_samples = 0;
188 188
189 /* Sort the active symbols */ 189 /* Sort the active symbols */
190 pthread_mutex_lock(&active_symbols_lock); 190 pthread_mutex_lock(&active_symbols_lock);
@@ -196,7 +196,7 @@ static void print_sym_table(void)
196 if (syme->snap_count != 0) { 196 if (syme->snap_count != 0) {
197 syme->weight = sym_weight(syme); 197 syme->weight = sym_weight(syme);
198 rb_insert_active_sym(&tmp, syme); 198 rb_insert_active_sym(&tmp, syme);
199 sum_kevents += syme->snap_count; 199 sum_ksamples += syme->snap_count;
200 200
201 for (j = 0; j < nr_counters; j++) 201 for (j = 0; j < nr_counters; j++)
202 syme->count[j] = zero ? 0 : syme->count[j] * 7 / 8; 202 syme->count[j] = zero ? 0 : syme->count[j] * 7 / 8;
@@ -209,8 +209,8 @@ static void print_sym_table(void)
209 printf( 209 printf(
210"------------------------------------------------------------------------------\n"); 210"------------------------------------------------------------------------------\n");
211 printf( " PerfTop:%8.0f irqs/sec kernel:%4.1f%% [", 211 printf( " PerfTop:%8.0f irqs/sec kernel:%4.1f%% [",
212 events_per_sec, 212 samples_per_sec,
213 100.0 - (100.0*((events_per_sec-kevents_per_sec)/events_per_sec))); 213 100.0 - (100.0*((samples_per_sec-ksamples_per_sec)/samples_per_sec)));
214 214
215 if (nr_counters == 1) { 215 if (nr_counters == 1) {
216 printf("%d", event_count[0]); 216 printf("%d", event_count[0]);
@@ -246,12 +246,12 @@ static void print_sym_table(void)
246 printf("------------------------------------------------------------------------------\n\n"); 246 printf("------------------------------------------------------------------------------\n\n");
247 247
248 if (nr_counters == 1) 248 if (nr_counters == 1)
249 printf(" events pcnt"); 249 printf(" samples pcnt");
250 else 250 else
251 printf(" weight events pcnt"); 251 printf(" weight samples pcnt");
252 252
253 printf(" RIP kernel function\n" 253 printf(" RIP kernel function\n"
254 " ______ ______ _____ ________________ _______________\n\n" 254 " ______ _______ _____ ________________ _______________\n\n"
255 ); 255 );
256 256
257 for (nd = rb_first(&tmp); nd; nd = rb_next(nd)) { 257 for (nd = rb_first(&tmp); nd; nd = rb_next(nd)) {
@@ -263,8 +263,8 @@ static void print_sym_table(void)
263 if (++printed > print_entries || syme->snap_count < count_filter) 263 if (++printed > print_entries || syme->snap_count < count_filter)
264 continue; 264 continue;
265 265
266 pcnt = 100.0 - (100.0 * ((sum_kevents - syme->snap_count) / 266 pcnt = 100.0 - (100.0 * ((sum_ksamples - syme->snap_count) /
267 sum_kevents)); 267 sum_ksamples));
268 268
269 /* 269 /*
270 * We color high-overhead entries in red, low-overhead 270 * We color high-overhead entries in red, low-overhead
@@ -276,9 +276,9 @@ static void print_sym_table(void)
276 color = PERF_COLOR_GREEN; 276 color = PERF_COLOR_GREEN;
277 277
278 if (nr_counters == 1) 278 if (nr_counters == 1)
279 printf("%19.2f - ", syme->weight); 279 printf("%20.2f - ", syme->weight);
280 else 280 else
281 printf("%8.1f %10ld - ", syme->weight, syme->snap_count); 281 printf("%9.1f %10ld - ", syme->weight, syme->snap_count);
282 282
283 color_fprintf(stdout, color, "%4.1f%%", pcnt); 283 color_fprintf(stdout, color, "%4.1f%%", pcnt);
284 printf(" - %016llx : %s\n", sym->start, sym->name); 284 printf(" - %016llx : %s\n", sym->start, sym->name);
@@ -318,7 +318,7 @@ static int symbol_filter(struct dso *self, struct symbol *sym)
318 return 1; 318 return 1;
319 319
320 syme = dso__sym_priv(self, sym); 320 syme = dso__sym_priv(self, sym);
321 /* Tag events to be skipped. */ 321 /* Tag samples to be skipped. */
322 if (!strcmp("default_idle", name) || 322 if (!strcmp("default_idle", name) ||
323 !strcmp("cpu_idle", name) || 323 !strcmp("cpu_idle", name) ||
324 !strcmp("enter_idle", name) || 324 !strcmp("enter_idle", name) ||
@@ -405,15 +405,15 @@ static void record_ip(uint64_t ip, int counter)
405 } 405 }
406 } 406 }
407 407
408 events--; 408 samples--;
409} 409}
410 410
411static void process_event(uint64_t ip, int counter) 411static void process_event(uint64_t ip, int counter)
412{ 412{
413 events++; 413 samples++;
414 414
415 if (ip < min_ip || ip > max_ip) { 415 if (ip < min_ip || ip > max_ip) {
416 userspace_events++; 416 userspace_samples++;
417 return; 417 return;
418 } 418 }
419 419
@@ -451,7 +451,7 @@ static void mmap_read(struct mmap_data *md)
451 451
452 /* 452 /*
453 * If we're further behind than half the buffer, there's a chance 453 * If we're further behind than half the buffer, there's a chance
454 * the writer will bite our tail and screw up the events under us. 454 * the writer will bite our tail and mess up the samples under us.
455 * 455 *
456 * If we somehow ended up ahead of the head, we got messed up. 456 * If we somehow ended up ahead of the head, we got messed up.
457 * 457 *
@@ -608,14 +608,14 @@ static int __cmd_top(void)
608 } 608 }
609 609
610 while (1) { 610 while (1) {
611 int hits = events; 611 int hits = samples;
612 612
613 for (i = 0; i < nr_cpus; i++) { 613 for (i = 0; i < nr_cpus; i++) {
614 for (counter = 0; counter < nr_counters; counter++) 614 for (counter = 0; counter < nr_counters; counter++)
615 mmap_read(&mmap_array[i][counter]); 615 mmap_read(&mmap_array[i][counter]);
616 } 616 }
617 617
618 if (hits == events) 618 if (hits == samples)
619 ret = poll(event_array, nr_poll, 100); 619 ret = poll(event_array, nr_poll, 100);
620 } 620 }
621 621