Patches contributed by Eötvös Lorand University
commit 3502973d005ed89cc2b3f39780813a341ddba97f
Author: Ingo Molnar <mingo@elte.hu>
Date: Wed Jun 3 09:38:58 2009 +0200
perf report: Print -D to stdout
-D prints to stderr - which is a bit confusing - print to stdout
instead.
Also clean up the if (dump_trace) patterns via a dprintf helper.
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: John Kacur <jkacur@redhat.com>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
diff --git a/Documentation/perf_counter/builtin-report.c b/Documentation/perf_counter/builtin-report.c
index 9da990fba4a5..6207a3147fcb 100644
--- a/Documentation/perf_counter/builtin-report.c
+++ b/Documentation/perf_counter/builtin-report.c
@@ -31,6 +31,8 @@ static int input;
static int show_mask = SHOW_KERNEL | SHOW_USER | SHOW_HV;
static int dump_trace = 0;
+#define dprintf(x...) do { if (dump_trace) printf(x); } while (0)
+
static int verbose;
static int full_paths;
@@ -729,14 +731,12 @@ static int __cmd_report(void)
uint64_t ip = event->ip.ip;
struct map *map = NULL;
- if (dump_trace) {
- fprintf(stderr, "%p [%p]: PERF_EVENT (IP, %d): %d: %p\n",
- (void *)(offset + head),
- (void *)(long)(event->header.size),
- event->header.misc,
- event->ip.pid,
- (void *)(long)ip);
- }
+ dprintf("%p [%p]: PERF_EVENT (IP, %d): %d: %p\n",
+ (void *)(offset + head),
+ (void *)(long)(event->header.size),
+ event->header.misc,
+ event->ip.pid,
+ (void *)(long)ip);
if (thread == NULL) {
fprintf(stderr, "problem processing %d event, skipping it.\n",
@@ -781,15 +781,14 @@ static int __cmd_report(void)
struct thread *thread = threads__findnew(event->mmap.pid);
struct map *map = map__new(&event->mmap, cwdp, cwdlen);
- if (dump_trace) {
- fprintf(stderr, "%p [%p]: PERF_EVENT_MMAP: [%p(%p) @ %p]: %s\n",
- (void *)(offset + head),
- (void *)(long)(event->header.size),
- (void *)(long)event->mmap.start,
- (void *)(long)event->mmap.len,
- (void *)(long)event->mmap.pgoff,
- event->mmap.filename);
- }
+ dprintf("%p [%p]: PERF_EVENT_MMAP: [%p(%p) @ %p]: %s\n",
+ (void *)(offset + head),
+ (void *)(long)(event->header.size),
+ (void *)(long)event->mmap.start,
+ (void *)(long)event->mmap.len,
+ (void *)(long)event->mmap.pgoff,
+ event->mmap.filename);
+
if (thread == NULL || map == NULL) {
if (verbose)
fprintf(stderr, "problem processing PERF_EVENT_MMAP, skipping event.\n");
@@ -802,12 +801,11 @@ static int __cmd_report(void)
case PERF_EVENT_COMM: {
struct thread *thread = threads__findnew(event->comm.pid);
- if (dump_trace) {
- fprintf(stderr, "%p [%p]: PERF_EVENT_COMM: %s:%d\n",
- (void *)(offset + head),
- (void *)(long)(event->header.size),
- event->comm.comm, event->comm.pid);
- }
+ dprintf("%p [%p]: PERF_EVENT_COMM: %s:%d\n",
+ (void *)(offset + head),
+ (void *)(long)(event->header.size),
+ event->comm.comm, event->comm.pid);
+
if (thread == NULL ||
thread__set_comm(thread, event->comm.comm)) {
fprintf(stderr, "problem processing PERF_EVENT_COMM, skipping event.\n");
@@ -818,11 +816,10 @@ static int __cmd_report(void)
}
default: {
broken_event:
- if (dump_trace)
- fprintf(stderr, "%p [%p]: skipping unknown header type: %d\n",
- (void *)(offset + head),
- (void *)(long)(event->header.size),
- event->header.type);
+ dprintf("%p [%p]: skipping unknown header type: %d\n",
+ (void *)(offset + head),
+ (void *)(long)(event->header.size),
+ event->header.type);
total_unknown++;
@@ -846,14 +843,13 @@ static int __cmd_report(void)
rc = EXIT_SUCCESS;
close(input);
- if (dump_trace) {
- fprintf(stderr, " IP events: %10ld\n", total);
- fprintf(stderr, " mmap events: %10ld\n", total_mmap);
- fprintf(stderr, " comm events: %10ld\n", total_comm);
- fprintf(stderr, " unknown events: %10ld\n", total_unknown);
+ dprintf(" IP events: %10ld\n", total);
+ dprintf(" mmap events: %10ld\n", total_mmap);
+ dprintf(" comm events: %10ld\n", total_comm);
+ dprintf(" unknown events: %10ld\n", total_unknown);
+ if (dump_trace)
return 0;
- }
if (verbose >= 2)
dsos__fprintf(stdout);
commit addc2785ce92ff05da8edf18317b6b4719e10d9f
Author: Ingo Molnar <mingo@elte.hu>
Date: Tue Jun 2 23:43:11 2009 +0200
perf record: Print out the number of events captured
It makes sense to inform the user about how many events
perf record has written - so that the sufficiency of
profiling coverage and intensity can be determined at
a glance.
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: John Kacur <jkacur@redhat.com>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
diff --git a/Documentation/perf_counter/builtin-record.c b/Documentation/perf_counter/builtin-record.c
index 2741b3561bb7..ec3b73adbd9d 100644
--- a/Documentation/perf_counter/builtin-record.c
+++ b/Documentation/perf_counter/builtin-record.c
@@ -467,6 +467,9 @@ static int __cmd_record(int argc, const char **argv)
ret = poll(event_array, nr_poll, 100);
}
+
+ fprintf(stderr, "[ perf record: Captured and wrote %ld events. ]\n", events);
+
return 0;
}
commit bf9e187637ca3d85cee7407e3af93995868cc87c
Author: Ingo Molnar <mingo@elte.hu>
Date: Tue Jun 2 23:37:05 2009 +0200
perf_counter tools: Make source code headers more coherent
The perf commands had different ways of describing themselves,
introduce a coherent command-file-header format taken from the
Git project.
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: John Kacur <jkacur@redhat.com>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
diff --git a/Documentation/perf_counter/builtin-record.c b/Documentation/perf_counter/builtin-record.c
index 8feb1192e09e..2741b3561bb7 100644
--- a/Documentation/perf_counter/builtin-record.c
+++ b/Documentation/perf_counter/builtin-record.c
@@ -1,9 +1,14 @@
/*
- * perf record: Record the profile of a workload (or a CPU, or a PID) into
- * the perf.data output file - for later analysis via perf report.
+ * builtin-record.c
+ *
+ * Builtin record command: Record the profile of a workload
+ * (or a CPU, or a PID) into the perf.data output file - for
+ * later analysis via perf report.
*/
-#include "perf.h"
#include "builtin.h"
+
+#include "perf.h"
+
#include "util/util.h"
#include "util/parse-options.h"
#include "util/parse-events.h"
diff --git a/Documentation/perf_counter/builtin-report.c b/Documentation/perf_counter/builtin-report.c
index 270e986c2d42..9da990fba4a5 100644
--- a/Documentation/perf_counter/builtin-report.c
+++ b/Documentation/perf_counter/builtin-report.c
@@ -1,6 +1,14 @@
-#include "util/util.h"
+/*
+ * builtin-report.c
+ *
+ * Builtin report command: Analyze the perf.data input file,
+ * look up and read DSOs and symbol information and display
+ * a histogram of results, along various sorting keys.
+ */
#include "builtin.h"
+#include "util/util.h"
+
#include "util/list.h"
#include "util/cache.h"
#include "util/rbtree.h"
diff --git a/Documentation/perf_counter/builtin-stat.c b/Documentation/perf_counter/builtin-stat.c
index 27abe6a2db3b..2357a663b675 100644
--- a/Documentation/perf_counter/builtin-stat.c
+++ b/Documentation/perf_counter/builtin-stat.c
@@ -1,20 +1,27 @@
/*
- * perf stat: /usr/bin/time -alike performance counter statistics utility
+ * builtin-stat.c
+ *
+ * Builtin stat command: Give a precise performance counters summary
+ * overview about any workload, CPU or specific PID.
+ *
+ * Sample output:
- It summarizes the counter events of all tasks (and child tasks),
- covering all CPUs that the command (or workload) executes on.
- It only counts the per-task events of the workload started,
- independent of how many other tasks run on those CPUs.
+ $ perf stat ~/hackbench 10
+ Time: 0.104
- Sample output:
+ Performance counter stats for '/home/mingo/hackbench':
- $ perf stat -e 1 -e 3 -e 5 ls -lR /usr/include/ >/dev/null
+ 1255.538611 task clock ticks # 10.143 CPU utilization factor
+ 54011 context switches # 0.043 M/sec
+ 385 CPU migrations # 0.000 M/sec
+ 17755 pagefaults # 0.014 M/sec
+ 3808323185 CPU cycles # 3033.219 M/sec
+ 1575111190 instructions # 1254.530 M/sec
+ 17367895 cache references # 13.833 M/sec
+ 7674421 cache misses # 6.112 M/sec
- Performance counter stats for 'ls':
+ Wall-clock time elapsed: 123.786620 msecs
- 163516953 instructions
- 2295 cache-misses
- 2855182 branch-misses
*
* Copyright (C) 2008, Red Hat Inc, Ingo Molnar <mingo@redhat.com>
*
diff --git a/Documentation/perf_counter/builtin-top.c b/Documentation/perf_counter/builtin-top.c
index 5029d8e6cd9c..a63935276cac 100644
--- a/Documentation/perf_counter/builtin-top.c
+++ b/Documentation/perf_counter/builtin-top.c
@@ -1,49 +1,25 @@
/*
- * kerneltop.c: show top kernel functions - performance counters showcase
-
- Build with:
-
- make -C Documentation/perf_counter/
-
- Sample output:
-
-------------------------------------------------------------------------------
- KernelTop: 2669 irqs/sec [cache-misses/cache-refs], (all, cpu: 2)
-------------------------------------------------------------------------------
-
- weight RIP kernel function
- ______ ________________ _______________
-
- 35.20 - ffffffff804ce74b : skb_copy_and_csum_dev
- 33.00 - ffffffff804cb740 : sock_alloc_send_skb
- 31.26 - ffffffff804ce808 : skb_push
- 22.43 - ffffffff80510004 : tcp_established_options
- 19.00 - ffffffff8027d250 : find_get_page
- 15.76 - ffffffff804e4fc9 : eth_type_trans
- 15.20 - ffffffff804d8baa : dst_release
- 14.86 - ffffffff804cf5d8 : skb_release_head_state
- 14.00 - ffffffff802217d5 : read_hpet
- 12.00 - ffffffff804ffb7f : __ip_local_out
- 11.97 - ffffffff804fc0c8 : ip_local_deliver_finish
- 8.54 - ffffffff805001a3 : ip_queue_xmit
+ * builtin-top.c
+ *
+ * Builtin top command: Display a continuously updated profile of
+ * any workload, CPU or specific PID.
+ *
+ * Copyright (C) 2008, Red Hat Inc, Ingo Molnar <mingo@redhat.com>
+ *
+ * Improvements and fixes by:
+ *
+ * Arjan van de Ven <arjan@linux.intel.com>
+ * Yanmin Zhang <yanmin.zhang@intel.com>
+ * Wu Fengguang <fengguang.wu@intel.com>
+ * Mike Galbraith <efault@gmx.de>
+ * Paul Mackerras <paulus@samba.org>
+ *
+ * Released under the GPL v2. (and only v2, not any later version)
*/
-
- /*
- * Copyright (C) 2008, Red Hat Inc, Ingo Molnar <mingo@redhat.com>
- *
- * Improvements and fixes by:
- *
- * Arjan van de Ven <arjan@linux.intel.com>
- * Yanmin Zhang <yanmin.zhang@intel.com>
- * Wu Fengguang <fengguang.wu@intel.com>
- * Mike Galbraith <efault@gmx.de>
- * Paul Mackerras <paulus@samba.org>
- *
- * Released under the GPL v2. (and only v2, not any later version)
- */
+#include "builtin.h"
#include "perf.h"
-#include "builtin.h"
+
#include "util/symbol.h"
#include "util/util.h"
#include "util/rbtree.h"
diff --git a/Documentation/perf_counter/perf.c b/Documentation/perf_counter/perf.c
index e8a85842b493..ec7edb7fbe29 100644
--- a/Documentation/perf_counter/perf.c
+++ b/Documentation/perf_counter/perf.c
@@ -1,4 +1,13 @@
+/*
+ * perf.c
+ *
+ * Performance analysis utility.
+ *
+ * This is the main hub from which the sub-commands (perf stat,
+ * perf top, perf record, perf report, etc.) are started.
+ */
#include "builtin.h"
+
#include "util/exec_cmd.h"
#include "util/cache.h"
#include "util/quote.h"
commit 0a520c63e1625b92ef775da40192e1542910e7f6
Author: Ingo Molnar <mingo@elte.hu>
Date: Tue Jun 2 23:24:45 2009 +0200
perf report: Print more info instead of <unknown> entries
Sometimes we still fail to find a DSO or look up a symbol,
print out the raw information in this case (which an help
debug the problem), instead of a not very helpful <unknown>
string.
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: John Kacur <jkacur@redhat.com>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
diff --git a/Documentation/perf_counter/builtin-report.c b/Documentation/perf_counter/builtin-report.c
index b84aaf18bf1f..270e986c2d42 100644
--- a/Documentation/perf_counter/builtin-report.c
+++ b/Documentation/perf_counter/builtin-report.c
@@ -201,7 +201,9 @@ static struct thread *thread__new(pid_t pid)
if (self != NULL) {
self->pid = pid;
- self->comm = NULL;
+ self->comm = malloc(30);
+ if (self->comm)
+ sprintf(self->comm, ":%d", pid);
INIT_LIST_HEAD(&self->maps);
}
@@ -333,7 +335,7 @@ sort__comm_cmp(struct hist_entry *left, struct hist_entry *right)
static size_t
sort__comm_print(FILE *fp, struct hist_entry *self)
{
- return fprintf(fp, " %16s", self->thread->comm ?: "<unknown>");
+ return fprintf(fp, " %16s", self->thread->comm);
}
static struct sort_entry sort_comm = {
@@ -363,7 +365,10 @@ sort__dso_cmp(struct hist_entry *left, struct hist_entry *right)
static size_t
sort__dso_print(FILE *fp, struct hist_entry *self)
{
- return fprintf(fp, " %-25s", self->dso ? self->dso->name : "<unknown>");
+ if (self->dso)
+ return fprintf(fp, " %-25s", self->dso->name);
+
+ return fprintf(fp, " %016llx", (__u64)self->ip);
}
static struct sort_entry sort_dso = {
@@ -392,11 +397,17 @@ sort__sym_print(FILE *fp, struct hist_entry *self)
size_t ret = 0;
if (verbose)
- ret += fprintf(fp, " %#018llx", (unsigned long long)self->ip);
+ ret += fprintf(fp, " %#018llx", (__u64)self->ip);
+
+ if (self->dso)
+ ret += fprintf(fp, " %s: ", self->dso->name);
+ else
+ ret += fprintf(fp, " %#016llx: ", (__u64)self->ip);
- ret += fprintf(fp, " %s: %s",
- self->dso ? self->dso->name : "<unknown>",
- self->sym ? self->sym->name : "<unknown>");
+ if (self->sym)
+ ret += fprintf(fp, "%s", self->sym->name);
+ else
+ ret += fprintf(fp, "%#016llx", (__u64)self->ip);
return ret;
}
@@ -772,7 +783,8 @@ static int __cmd_report(void)
event->mmap.filename);
}
if (thread == NULL || map == NULL) {
- fprintf(stderr, "problem processing PERF_EVENT_MMAP, skipping event.\n");
+ if (verbose)
+ fprintf(stderr, "problem processing PERF_EVENT_MMAP, skipping event.\n");
goto broken_event;
}
thread__insert_map(thread, map);
commit 3cf165fc2e7f221a7a95098b47eb990779e29f5f
Author: Ingo Molnar <mingo@elte.hu>
Date: Tue Jun 2 23:02:59 2009 +0200
perf record: Increase mmap buffering default
I've run into mmap overruns with the current 16 pages default,
increase it to 128 pages.
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: John Kacur <jkacur@redhat.com>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
diff --git a/Documentation/perf_counter/builtin-record.c b/Documentation/perf_counter/builtin-record.c
index 19cba6b5ee9c..8feb1192e09e 100644
--- a/Documentation/perf_counter/builtin-record.c
+++ b/Documentation/perf_counter/builtin-record.c
@@ -19,9 +19,9 @@ static int default_interval = 100000;
static int event_count[MAX_COUNTERS];
static int fd[MAX_NR_CPUS][MAX_COUNTERS];
-static int nr_cpus = 0;
+static int nr_cpus = 0;
static unsigned int page_size;
-static unsigned int mmap_pages = 16;
+static unsigned int mmap_pages = 128;
static int output;
static const char *output_name = "perf.data";
static int group = 0;
commit abaff32a03e26e5d6674cb2a26ad882efe7493a3
Author: Ingo Molnar <mingo@elte.hu>
Date: Tue Jun 2 22:59:57 2009 +0200
perf record: Add --append option
Allow incremental profiling via 'perf record -A' - this will append
to an existing perf.data.
Also reorder perf record options by utility / likelyhood of usage.
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: John Kacur <jkacur@redhat.com>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
diff --git a/Documentation/perf_counter/builtin-record.c b/Documentation/perf_counter/builtin-record.c
index c2fd04244972..19cba6b5ee9c 100644
--- a/Documentation/perf_counter/builtin-record.c
+++ b/Documentation/perf_counter/builtin-record.c
@@ -1,5 +1,7 @@
-
-
+/*
+ * perf record: Record the profile of a workload (or a CPU, or a PID) into
+ * the perf.data output file - for later analysis via perf report.
+ */
#include "perf.h"
#include "builtin.h"
#include "util/util.h"
@@ -28,6 +30,7 @@ static int system_wide = 0;
static pid_t target_pid = -1;
static int inherit = 1;
static int force = 0;
+static int append_file = 0;
const unsigned int default_count[] = {
1000000,
@@ -385,22 +388,29 @@ static void open_counters(int cpu, pid_t pid)
static int __cmd_record(int argc, const char **argv)
{
int i, counter;
+ struct stat st;
pid_t pid;
+ int flags;
int ret;
- struct stat st;
page_size = sysconf(_SC_PAGE_SIZE);
nr_cpus = sysconf(_SC_NPROCESSORS_ONLN);
assert(nr_cpus <= MAX_NR_CPUS);
assert(nr_cpus >= 0);
- if (!stat(output_name, &st) && !force) {
- fprintf(stderr, "Error, output file: %s exists, use -f to overwrite.\n",
+ if (!stat(output_name, &st) && !force && !append_file) {
+ fprintf(stderr, "Error, output file %s exists, use -A to append or -f to overwrite.\n",
output_name);
exit(-1);
}
- output = open(output_name, O_CREAT|O_TRUNC|O_RDWR, S_IRUSR|S_IWUSR);
+ flags = O_CREAT|O_RDWR;
+ if (append_file)
+ flags |= O_APPEND;
+ else
+ flags |= O_TRUNC;
+
+ output = open(output_name, flags, S_IRUSR|S_IWUSR);
if (output < 0) {
perror("failed to create output file");
exit(-1);
@@ -466,22 +476,24 @@ static char events_help_msg[EVENTS_HELP_MAX];
static const struct option options[] = {
OPT_CALLBACK('e', "event", NULL, "event",
events_help_msg, parse_events),
- OPT_INTEGER('c', "count", &default_interval,
- "event period to sample"),
- OPT_INTEGER('m', "mmap-pages", &mmap_pages,
- "number of mmap data pages"),
- OPT_STRING('o', "output", &output_name, "file",
- "output file name"),
- OPT_BOOLEAN('i', "inherit", &inherit,
- "child tasks inherit counters"),
OPT_INTEGER('p', "pid", &target_pid,
"record events on existing pid"),
OPT_INTEGER('r', "realtime", &realtime_prio,
"collect data with this RT SCHED_FIFO priority"),
OPT_BOOLEAN('a', "all-cpus", &system_wide,
"system-wide collection from all CPUs"),
+ OPT_BOOLEAN('A', "append", &append_file,
+ "append to the output file to do incremental profiling"),
OPT_BOOLEAN('f', "force", &force,
"overwrite existing data file"),
+ OPT_INTEGER('c', "count", &default_interval,
+ "event period to sample"),
+ OPT_STRING('o', "output", &output_name, "file",
+ "output file name"),
+ OPT_BOOLEAN('i', "inherit", &inherit,
+ "child tasks inherit counters"),
+ OPT_INTEGER('m', "mmap-pages", &mmap_pages,
+ "number of mmap data pages"),
OPT_END()
};
commit cf25c63c609e99bfb9303b68a7a90a56a3a32cea
Author: Ingo Molnar <mingo@elte.hu>
Date: Tue Jun 2 22:12:14 2009 +0200
perf report: Fix column width/alignment of dsos
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: John Kacur <jkacur@redhat.com>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
diff --git a/Documentation/perf_counter/builtin-report.c b/Documentation/perf_counter/builtin-report.c
index 6d68f3aa86b7..b84aaf18bf1f 100644
--- a/Documentation/perf_counter/builtin-report.c
+++ b/Documentation/perf_counter/builtin-report.c
@@ -303,11 +303,11 @@ sort__thread_cmp(struct hist_entry *left, struct hist_entry *right)
static size_t
sort__thread_print(FILE *fp, struct hist_entry *self)
{
- return fprintf(fp, " %16s:%5d", self->thread->comm ?: "", self->thread->pid);
+ return fprintf(fp, " %16s:%5d", self->thread->comm ?: "", self->thread->pid);
}
static struct sort_entry sort_thread = {
- .header = " Command: Pid ",
+ .header = " Command: Pid ",
.cmp = sort__thread_cmp,
.print = sort__thread_print,
};
@@ -363,11 +363,11 @@ sort__dso_cmp(struct hist_entry *left, struct hist_entry *right)
static size_t
sort__dso_print(FILE *fp, struct hist_entry *self)
{
- return fprintf(fp, " %s", self->dso ? self->dso->name : "<unknown>");
+ return fprintf(fp, " %-25s", self->dso ? self->dso->name : "<unknown>");
}
static struct sort_entry sort_dso = {
- .header = " Shared Object",
+ .header = " Shared Object ",
.cmp = sort__dso_cmp,
.print = sort__dso_print,
};
commit 4593bba8679b925a056f84edac061676e7eda71c
Author: Ingo Molnar <mingo@elte.hu>
Date: Tue Jun 2 15:34:25 2009 +0200
perf report: Clean up the default output
- extra space between columns
- left-aligned the symbol column
- moved the no-symbols printout to -v
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: John Kacur <jkacur@redhat.com>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
diff --git a/Documentation/perf_counter/builtin-report.c b/Documentation/perf_counter/builtin-report.c
index 0558c1e1aa5b..19c1e056bb66 100644
--- a/Documentation/perf_counter/builtin-report.c
+++ b/Documentation/perf_counter/builtin-report.c
@@ -84,24 +84,25 @@ static struct dso *dsos__findnew(const char *name)
struct dso *dso = dsos__find(name);
int nr;
- if (dso == NULL) {
- dso = dso__new(name, 0);
- if (!dso)
- goto out_delete_dso;
-
- nr = dso__load(dso, NULL);
- if (nr < 0) {
- fprintf(stderr, "Failed to open: %s\n", name);
- goto out_delete_dso;
- }
- if (!nr) {
- fprintf(stderr,
- "Failed to find debug symbols for: %s, maybe install a debug package?\n",
- name);
- }
+ if (dso)
+ return dso;
+
+ dso = dso__new(name, 0);
+ if (!dso)
+ goto out_delete_dso;
- dsos__add(dso);
+ nr = dso__load(dso, NULL);
+ if (nr < 0) {
+ fprintf(stderr, "Failed to open: %s\n", name);
+ goto out_delete_dso;
}
+ if (!nr && verbose) {
+ fprintf(stderr,
+ "No symbols found in: %s, maybe install a debug package?\n",
+ name);
+ }
+
+ dsos__add(dso);
return dso;
@@ -302,11 +303,11 @@ sort__thread_cmp(struct hist_entry *left, struct hist_entry *right)
static size_t
sort__thread_print(FILE *fp, struct hist_entry *self)
{
- return fprintf(fp, " %16s:%5d", self->thread->comm ?: "", self->thread->pid);
+ return fprintf(fp, " %16s:%5d", self->thread->comm ?: "", self->thread->pid);
}
static struct sort_entry sort_thread = {
- .header = " Command: Pid ",
+ .header = " Command: Pid ",
.cmp = sort__thread_cmp,
.print = sort__thread_print,
};
@@ -332,11 +333,11 @@ sort__comm_cmp(struct hist_entry *left, struct hist_entry *right)
static size_t
sort__comm_print(FILE *fp, struct hist_entry *self)
{
- return fprintf(fp, " %16s", self->thread->comm ?: "<unknown>");
+ return fprintf(fp, " %16s", self->thread->comm ?: "<unknown>");
}
static struct sort_entry sort_comm = {
- .header = " Command",
+ .header = " Command",
.cmp = sort__comm_cmp,
.print = sort__comm_print,
};
@@ -362,11 +363,11 @@ sort__dso_cmp(struct hist_entry *left, struct hist_entry *right)
static size_t
sort__dso_print(FILE *fp, struct hist_entry *self)
{
- return fprintf(fp, " %64s", self->dso ? self->dso->name : "<unknown>");
+ return fprintf(fp, " %s", self->dso ? self->dso->name : "<unknown>");
}
static struct sort_entry sort_dso = {
- .header = " Shared Object",
+ .header = " Shared Object",
.cmp = sort__dso_cmp,
.print = sort__dso_print,
};
@@ -391,9 +392,9 @@ sort__sym_print(FILE *fp, struct hist_entry *self)
size_t ret = 0;
if (verbose)
- ret += fprintf(fp, " %#018llx", (unsigned long long)self->ip);
+ ret += fprintf(fp, " %#018llx", (unsigned long long)self->ip);
- ret += fprintf(fp, " %s: %s",
+ ret += fprintf(fp, " %s: %s",
self->dso ? self->dso->name : "<unknown>",
self->sym ? self->sym->name : "<unknown>");
@@ -401,7 +402,7 @@ sort__sym_print(FILE *fp, struct hist_entry *self)
}
static struct sort_entry sort_sym = {
- .header = "Shared Object: Symbol",
+ .header = " Shared Object: Symbol",
.cmp = sort__sym_cmp,
.print = sort__sym_print,
};
@@ -595,8 +596,8 @@ static size_t output__fprintf(FILE *fp, uint64_t total_samples)
list_for_each_entry(se, &hist_entry__sort_list, list) {
int i;
- fprintf(fp, " ");
- for (i = 0; i < strlen(se->header); i++)
+ fprintf(fp, " ");
+ for (i = 0; i < strlen(se->header)-1; i++)
fprintf(fp, ".");
}
fprintf(fp, "\n");
commit ee4c24a5c9b530481394132c8dbc10572d57c075
Merge: 3d58f48ba05c 3e0c373749d7
Author: Ingo Molnar <mingo@elte.hu>
Date: Mon Jun 1 22:29:35 2009 +0200
Merge branch 'x86/cpufeature' into irq/numa
Merge reason: irq/numa didnt build because this commit:
2759c32: x86: don't call read_apic_id if !cpu_has_apic
Had a dependency on x86/cpufeature changes. Pull in that
(small) branch to fix the dependency.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
commit 3d58f48ba05caed9118bce62b3047f8683438835
Merge: abfe0af98131 d9244b5d2fbf
Author: Ingo Molnar <mingo@elte.hu>
Date: Mon Jun 1 21:06:21 2009 +0200
Merge branch 'linus' into irq/numa
Conflicts:
arch/mips/sibyte/bcm1480/irq.c
arch/mips/sibyte/sb1250/irq.c
Merge reason: we gathered a few conflicts plus update to latest upstream fixes.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
diff --cc arch/mips/sibyte/bcm1480/irq.c
index 4f256a131bf6,c147c4b35d3f..690de06bde90
--- a/arch/mips/sibyte/bcm1480/irq.c
+++ b/arch/mips/sibyte/bcm1480/irq.c
@@@ -153,10 -151,7 +151,9 @@@ static int bcm1480_set_affinity(unsigne
____raw_writeq(cur_ints, IOADDR(A_BCM1480_IMR_MAPPER(cpu) + R_BCM1480_IMR_INTERRUPT_MASK_H + (k*BCM1480_IMR_HL_SPACING)));
}
}
- spin_unlock(&bcm1480_imr_lock);
- spin_unlock_irqrestore(&desc->lock, flags);
+ spin_unlock_irqrestore(&bcm1480_imr_lock, flags);
+
+ return 0;
}
#endif
diff --cc arch/mips/sibyte/sb1250/irq.c
index e389507f1f96,38cb998ade22..409dec798863
--- a/arch/mips/sibyte/sb1250/irq.c
+++ b/arch/mips/sibyte/sb1250/irq.c
@@@ -144,10 -142,7 +142,9 @@@ static int sb1250_set_affinity(unsigne
____raw_writeq(cur_ints, IOADDR(A_IMR_MAPPER(cpu) +
R_IMR_INTERRUPT_MASK));
}
- spin_unlock(&sb1250_imr_lock);
- spin_unlock_irqrestore(&desc->lock, flags);
+ spin_unlock_irqrestore(&sb1250_imr_lock, flags);
+
+ return 0;
}
#endif