mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: tip-bot for Arnaldo Carvalho de Melo <acme@redhat.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, paulus@samba.org, acme@redhat.com,
	hpa@zytor.com, mingo@redhat.com, efault@gmx.de,
	peterz@infradead.org, fweisbec@gmail.com, tglx@linutronix.de,
	mingo@elte.hu
Subject: [tip:branch?] perf annotate: Remove requirement of passing a symbol name
Date: Sat, 24 Oct 2009 01:03:48 GMT	[thread overview]
Message-ID: <tip-8f0b037398a909ccf703ad5f5803066db6327f22@git.kernel.org> (raw)
In-Reply-To: <1256058509-19678-1-git-send-email-acme@redhat.com>

Commit-ID:  8f0b037398a909ccf703ad5f5803066db6327f22
Gitweb:     http://git.kernel.org/tip/8f0b037398a909ccf703ad5f5803066db6327f22
Author:     Arnaldo Carvalho de Melo <acme@redhat.com>
AuthorDate: Tue, 20 Oct 2009 15:08:29 -0200
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Tue, 20 Oct 2009 21:12:58 +0200

perf annotate: Remove requirement of passing a symbol name

If the user doesn't pass a symbol name to annotate, it will
annotate all the symbols that have hits, in order, just like
'perf report -s comm,dso,symbol'.

This is a natural followup patch to the one that uses
output_hists to find the symbols with hits.

The common case is to annotate the first few entries at the top
of a perf report, so lets type less characters.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Mike Galbraith <efault@gmx.de>
LKML-Reference: <1256058509-19678-1-git-send-email-acme@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 tools/perf/builtin-annotate.c |   11 ++---------
 1 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index 2456925..99bac6a 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -57,7 +57,8 @@ static const char *sym_hist_filter;
 
 static int symbol_filter(struct map *map, struct symbol *sym)
 {
-	if (strcmp(sym->name, sym_hist_filter) == 0) {
+	if (sym_hist_filter == NULL ||
+	    strcmp(sym->name, sym_hist_filter) == 0) {
 		struct sym_priv *priv = dso__sym_priv(map->dso, sym);
 		const int size = (sizeof(*priv->hist) +
 				  (sym->end - sym->start) * sizeof(u64));
@@ -581,7 +582,6 @@ static void annotate_sym(struct hist_entry *he)
 static void find_annotations(void)
 {
 	struct rb_node *nd;
-	int count = 0;
 
 	for (nd = rb_first(&output_hists); nd; nd = rb_next(nd)) {
 		struct hist_entry *he = rb_entry(nd, struct hist_entry, rb_node);
@@ -595,7 +595,6 @@ static void find_annotations(void)
 			continue;
 
 		annotate_sym(he);
-		count++;
 		/*
 		 * Since we have a hist_entry per IP for the same symbol, free
 		 * he->sym->hist to signal we already processed this symbol.
@@ -603,9 +602,6 @@ static void find_annotations(void)
 		free(priv->hist);
 		priv->hist = NULL;
 	}
-
-	if (!count)
-		printf(" Error: symbol '%s' not present amongst the samples.\n", sym_hist_filter);
 }
 
 static int __cmd_annotate(void)
@@ -793,9 +789,6 @@ int cmd_annotate(int argc, const char **argv, const char *prefix __used)
 		sym_hist_filter = argv[0];
 	}
 
-	if (!sym_hist_filter)
-		usage_with_options(annotate_usage, options);
-
 	setup_pager();
 
 	if (field_sep && *field_sep == '.') {

      reply	other threads:[~2009-10-24  1:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-20 17:08 [PATCH] " Arnaldo Carvalho de Melo
2009-10-24  1:03 ` tip-bot for Arnaldo Carvalho de Melo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-8f0b037398a909ccf703ad5f5803066db6327f22@git.kernel.org \
    --to=acme@redhat.com \
    --cc=efault@gmx.de \
    --cc=fweisbec@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mingo@redhat.com \
    --cc=paulus@samba.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®