This message generated a parse failure. Raw output follows here. Please use 'back' to navigate. From devnull@lkml.org Thu Apr 25 14:50:24 2024 Delivery-date: Fri, 05 Jun 2009 15:34:38 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752030AbZFENeI (ORCPT ); Fri, 5 Jun 2009 09:34:08 -0400 Received: from hera.kernel.org ([140.211.167.34]:56251 "EHLO hera.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751468AbZFENeF (ORCPT ); Fri, 5 Jun 2009 09:34:05 -0400 Received: from hera.kernel.org (IDENT:U2FsdGVkX1+8xoW/d6wIubzGWHsNFckSkLAgVy9Soi0@localhost [127.0.0.1]) by hera.kernel.org (8.14.2/8.14.2) with ESMTP id n55DXX1t025689 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 5 Jun 2009 13:33:33 GM Received: (from hpa@localhost) by hera.kernel.org (8.14.2/8.13.1/Submit) id n55DXVbW025685; Fri, 5 Jun 2009 13:33:31 GMT Date: Fri, 5 Jun 2009 13:33:31 GMT From: tip-bot for Ingo Molnar To: linux-tip-commits@vger.kernel.org Cc: linux-kernel@vger.kernel.org, acme@redhat.com, paulus@samba.org, hpa@zytor.com, mingo@redhat.com, a.p.zijlstra@chello.nl, efault@gmx.de, tglx@linutronix.de, mingo@elte.hu Reply-To: mingo@redhat.com, hpa@zytor.com, paulus@samba.org, acme@redhat.com, linux-kernel@vger.kernel.org, a.p.zijlstra@chello.nl, efault@gmx.de, tglx@linutronix.de, mingo@elte.hu In-Reply-To: References: Subject: [tip:perfcounters/core] perf record/top: Clarify events/samples naming Message-Id: Git-Commit-ID: 6eb1642e07c0f84861971bcdd6f0e7236198b402 X-Mailer: tip-git-log-daemon Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Virus-Scanned: ClamAV 0.93.3/9426/Fri Jun 5 13:01:24 2009 on hera.kernel.org X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,UNPARSEABLE_RELAY autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on hera.kernel.org X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.0 (hera.kernel.org [127.0.0.1]); Fri, 05 Jun 2009 13:33:33 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-Id: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 6eb1642e07c0f84861971bcdd6f0e7236198b402 Gitweb: http://git.kernel.org/tip/6eb1642e07c0f84861971bcdd6f0e7236198b402 Author: Ingo Molnar AuthorDate: Fri, 5 Jun 2009 14:29:10 +0200 Committer: Ingo Molnar CommitDate: Fri, 5 Jun 2009 14:29:10 +0200 perf record/top: Clarify events/samples naming A number of places said 'events' while they should say 'samples'. Cc: Peter Zijlstra Cc: Mike Galbraith Cc: Paul Mackerras Cc: Arnaldo Carvalho de Melo LKML-Reference: Signed-off-by: Ingo Molnar --- Documentation/perf_counter/builtin-record.c | 22 ++++++------ Documentation/perf_counter/builtin-top.c | 46 +++++++++++++------------- 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/Documentation/perf_counter/builtin-record.c b/Documentation/perf_counter/builtin-record.c index e2301f3..d4ad305 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) return head; } -static long events; +static long samples; static struct timeval last_read, this_read; static __u64 bytes_written; @@ -83,7 +83,7 @@ static void mmap_read(struct mmap_data *md) /* * If we're further behind than half the buffer, there's a chance - * the writer will bite our tail and screw up the events under us. + * the writer will bite our tail and mess up the samples under us. * * If we somehow ended up ahead of the head, we got messed up. * @@ -109,7 +109,7 @@ static void mmap_read(struct mmap_data *md) last_read = this_read; if (old != head) - events++; + samples++; size = head - old; @@ -257,7 +257,7 @@ out_failure: exit(EXIT_FAILURE); } -static void pid_synthesize_mmap_events(pid_t pid) +static void pid_synthesize_mmap_samples(pid_t pid) { char filename[PATH_MAX]; FILE *fp; @@ -315,7 +315,7 @@ static void pid_synthesize_mmap_events(pid_t pid) fclose(fp); } -static void synthesize_events(void) +static void synthesize_samples(void) { DIR *proc; struct dirent dirent, *next; @@ -331,7 +331,7 @@ static void synthesize_events(void) continue; pid_synthesize_comm_event(pid, 1); - pid_synthesize_mmap_events(pid); + pid_synthesize_mmap_samples(pid); } closedir(proc); @@ -396,7 +396,7 @@ static void open_counters(int cpu, pid_t pid) if (pid > 0) { pid_synthesize_comm_event(pid, 0); - pid_synthesize_mmap_events(pid); + pid_synthesize_mmap_samples(pid); } group_fd = -1; @@ -469,17 +469,17 @@ static int __cmd_record(int argc, const char **argv) } if (system_wide) - synthesize_events(); + synthesize_samples(); while (!done) { - int hits = events; + int hits = samples; for (i = 0; i < nr_cpu; i++) { for (counter = 0; counter < nr_counters; counter++) mmap_read(&mmap_array[i][counter]); } - if (hits == events) + if (hits == samples) ret = poll(event_array, nr_poll, 100); } @@ -487,7 +487,7 @@ static int __cmd_record(int argc, const char **argv) * Approximate RIP event size: 24 bytes. */ fprintf(stderr, - "[ perf record: Captured and wrote %.3f MB %s (~%lld events) ]\n", + "[ perf record: Captured and wrote %.3f MB %s (~%lld samples) ]\n", (double)bytes_written / 1024.0 / 1024.0, output_name, bytes_written / 24); diff --git a/Documentation/perf_counter/builtin-top.c b/Documentation/perf_counter/builtin-top.c index 2fee595..ff7e13c 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) return weight; } -static long events; -static long userspace_events; +static long samples; +static long userspace_samples; static const char CONSOLE_CLEAR[] = ""; static void __list_insert_active_sym(struct sym_entry *syme) @@ -177,14 +177,14 @@ static void print_sym_table(void) { int printed = 0, j; int counter; - float events_per_sec = events/delay_secs; - float kevents_per_sec = (events-userspace_events)/delay_secs; - float sum_kevents = 0.0; + float samples_per_sec = samples/delay_secs; + float ksamples_per_sec = (samples-userspace_samples)/delay_secs; + float sum_ksamples = 0.0; struct sym_entry *syme, *n; struct rb_root tmp = RB_ROOT; struct rb_node *nd; - events = userspace_events = 0; + samples = userspace_samples = 0; /* Sort the active symbols */ pthread_mutex_lock(&active_symbols_lock); @@ -196,7 +196,7 @@ static void print_sym_table(void) if (syme->snap_count != 0) { syme->weight = sym_weight(syme); rb_insert_active_sym(&tmp, syme); - sum_kevents += syme->snap_count; + sum_ksamples += syme->snap_count; for (j = 0; j < nr_counters; j++) syme->count[j] = zero ? 0 : syme->count[j] * 7 / 8; @@ -209,8 +209,8 @@ static void print_sym_table(void) printf( "------------------------------------------------------------------------------\n"); printf( " PerfTop:%8.0f irqs/sec kernel:%4.1f%% [", - events_per_sec, - 100.0 - (100.0*((events_per_sec-kevents_per_sec)/events_per_sec))); + samples_per_sec, + 100.0 - (100.0*((samples_per_sec-ksamples_per_sec)/samples_per_sec))); if (nr_counters == 1) { printf("%d", event_count[0]); @@ -246,12 +246,12 @@ static void print_sym_table(void) printf("------------------------------------------------------------------------------\n\n"); if (nr_counters == 1) - printf(" events pcnt"); + printf(" samples pcnt"); else - printf(" weight events pcnt"); + printf(" weight samples pcnt"); printf(" RIP kernel function\n" - " ______ ______ _____ ________________ _______________\n\n" + " ______ _______ _____ ________________ _______________\n\n" ); for (nd = rb_first(&tmp); nd; nd = rb_next(nd)) { @@ -263,8 +263,8 @@ static void print_sym_table(void) if (++printed > print_entries || syme->snap_count < count_filter) continue; - pcnt = 100.0 - (100.0 * ((sum_kevents - syme->snap_count) / - sum_kevents)); + pcnt = 100.0 - (100.0 * ((sum_ksamples - syme->snap_count) / + sum_ksamples)); /* * We color high-overhead entries in red, low-overhead @@ -276,9 +276,9 @@ static void print_sym_table(void) color = PERF_COLOR_GREEN; if (nr_counters == 1) - printf("%19.2f - ", syme->weight); + printf("%20.2f - ", syme->weight); else - printf("%8.1f %10ld - ", syme->weight, syme->snap_count); + printf("%9.1f %10ld - ", syme->weight, syme->snap_count); color_fprintf(stdout, color, "%4.1f%%", pcnt); printf(" - %016llx : %s\n", sym->start, sym->name); @@ -318,7 +318,7 @@ static int symbol_filter(struct dso *self, struct symbol *sym) return 1; syme = dso__sym_priv(self, sym); - /* Tag events to be skipped. */ + /* Tag samples to be skipped. */ if (!strcmp("default_idle", name) || !strcmp("cpu_idle", name) || !strcmp("enter_idle", name) || @@ -405,15 +405,15 @@ static void record_ip(uint64_t ip, int counter) } } - events--; + samples--; } static void process_event(uint64_t ip, int counter) { - events++; + samples++; if (ip < min_ip || ip > max_ip) { - userspace_events++; + userspace_samples++; return; } @@ -451,7 +451,7 @@ static void mmap_read(struct mmap_data *md) /* * If we're further behind than half the buffer, there's a chance - * the writer will bite our tail and screw up the events under us. + * the writer will bite our tail and mess up the samples under us. * * If we somehow ended up ahead of the head, we got messed up. * @@ -608,14 +608,14 @@ static int __cmd_top(void) } while (1) { - int hits = events; + int hits = samples; for (i = 0; i < nr_cpus; i++) { for (counter = 0; counter < nr_counters; counter++) mmap_read(&mmap_array[i][counter]); } - if (hits == events) + if (hits == samples) ret = poll(event_array, nr_poll, 100); } -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/