From: Arnaldo Carvalho de Melo <acme@infradead.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org,
Arnaldo Carvalho de Melo <acme@redhat.com>,
David Ahern <dsahern@gmail.com>,
Frederic Weisbecker <fweisbec@gmail.com>,
Jiri Olsa <jolsa@redhat.com>, Mike Galbraith <efault@gmx.de>,
Namhyung Kim <namhyung@gmail.com>,
Paul Mackerras <paulus@samba.org>,
Peter Zijlstra <peterz@infradead.org>,
Stephane Eranian <eranian@google.com>
Subject: [PATCH 15/20] perf tools: Don't access evsel->name directly
Date: Tue, 19 Jun 2012 14:50:16 -0300 [thread overview]
Message-ID: <1340128221-17348-16-git-send-email-acme@infradead.org> (raw)
In-Reply-To: <1340128221-17348-1-git-send-email-acme@infradead.org>
From: Arnaldo Carvalho de Melo <acme@redhat.com>
One needs to use perf_evsel__name() so that if needed the name gets
synthesized and stored in evsel->name, from where perf_evsel__name()
will serve from them on.
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-ml7zbenjmri9bghmrea0jm0d@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/builtin-sched.c | 2 +-
tools/perf/util/parse-events-test.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c
index b125e07..9fe77b1 100644
--- a/tools/perf/builtin-sched.c
+++ b/tools/perf/builtin-sched.c
@@ -1601,7 +1601,7 @@ static int perf_sched__process_tracepoint_sample(struct perf_tool *tool,
if (thread == NULL) {
pr_debug("problem processing %s event, skipping it.\n",
- evsel->name);
+ perf_evsel__name(evsel));
return -1;
}
diff --git a/tools/perf/util/parse-events-test.c b/tools/perf/util/parse-events-test.c
index 76b98e2..d0cf7c1 100644
--- a/tools/perf/util/parse-events-test.c
+++ b/tools/perf/util/parse-events-test.c
@@ -418,14 +418,14 @@ static int test__checkevent_pmu_name(struct perf_evlist *evlist)
TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->nr_entries);
TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->attr.type);
TEST_ASSERT_VAL("wrong config", 1 == evsel->attr.config);
- TEST_ASSERT_VAL("wrong name", !strcmp(evsel->name, "krava"));
+ TEST_ASSERT_VAL("wrong name", !strcmp(perf_evsel__name(evsel), "krava"));
/* cpu/config=2/" */
evsel = list_entry(evsel->node.next, struct perf_evsel, node);
TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->nr_entries);
TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->attr.type);
TEST_ASSERT_VAL("wrong config", 2 == evsel->attr.config);
- TEST_ASSERT_VAL("wrong name", !strcmp(evsel->name, "raw 0x2"));
+ TEST_ASSERT_VAL("wrong name", !strcmp(perf_evsel__name(evsel), "raw 0x2"));
return 0;
}
--
1.7.1
next prev parent reply other threads:[~2012-06-19 18:03 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-19 17:50 [GIT PULL 00/20] perf/core improvements Arnaldo Carvalho de Melo
2012-06-19 17:50 ` [PATCH 01/20] perf tools: Add sort by src line/number Arnaldo Carvalho de Melo
2012-06-19 17:50 ` [PATCH 02/20] perf ui: Introduce struct perf_error_ops Arnaldo Carvalho de Melo
2012-06-19 17:50 ` [PATCH 03/20] perf ui/gtk: Introduce struct perf_gtk_context Arnaldo Carvalho de Melo
2012-06-19 17:50 ` [PATCH 04/20] perf ui/gtk: Add GTK statusbar widget to browser window Arnaldo Carvalho de Melo
2012-06-19 17:50 ` [PATCH 05/20] perf ui/gtk: Add GTK info_bar " Arnaldo Carvalho de Melo
2012-06-19 17:50 ` [PATCH 06/20] perf ui/gtk: Use struct perf_error_ops Arnaldo Carvalho de Melo
2012-06-19 17:50 ` [PATCH 07/20] perf lib: Introduce rtrim Arnaldo Carvalho de Melo
2012-06-19 17:50 ` [PATCH 08/20] perf hists browser: Implement printing snapshots to files Arnaldo Carvalho de Melo
2012-06-19 17:50 ` [PATCH 09/20] perf evsel: Carve out event modifier formatting Arnaldo Carvalho de Melo
2012-06-19 17:50 ` [PATCH 10/20] perf tools: Reconstruct hw cache event with modifiers from perf_event_attr Arnaldo Carvalho de Melo
2012-06-19 17:50 ` [PATCH 11/20] perf tools: Reconstruct sw " Arnaldo Carvalho de Melo
2012-06-19 17:50 ` [PATCH 12/20] perf evsel: Handle all event types in perf_evsel__name Arnaldo Carvalho de Melo
2012-06-19 17:50 ` [PATCH 13/20] perf tools: Move all users of event_name to perf_evsel__name Arnaldo Carvalho de Melo
2012-06-19 17:50 ` [PATCH 14/20] perf script: Replace __event_name uses with perf_evsel__name Arnaldo Carvalho de Melo
2012-06-19 17:50 ` Arnaldo Carvalho de Melo [this message]
2012-06-19 17:50 ` [PATCH 16/20] perf tools: Remove __event_name Arnaldo Carvalho de Melo
2012-06-19 17:50 ` [PATCH 17/20] perf evsel: Reconstruct raw event with modifiers from perf_event_attr Arnaldo Carvalho de Melo
2012-06-19 17:50 ` [PATCH 18/20] perf tools: Remove unused evsel parameter from machine__resolve_callchain Arnaldo Carvalho de Melo
2012-06-19 17:50 ` [PATCH 19/20] perf evsel: Make some methods private Arnaldo Carvalho de Melo
2012-06-19 17:50 ` [PATCH 20/20] perf annotate: Check null of sym pointer before using it Arnaldo Carvalho de Melo
2012-06-20 12:01 ` [GIT PULL 00/20] perf/core improvements Ingo Molnar
2012-06-20 14:07 ` Namhyung Kim
2012-06-20 14:49 ` Ingo Molnar
2012-06-22 4:16 ` Namhyung Kim
2012-06-25 8:22 ` Ingo Molnar
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=1340128221-17348-16-git-send-email-acme@infradead.org \
--to=acme@infradead.org \
--cc=acme@redhat.com \
--cc=dsahern@gmail.com \
--cc=efault@gmx.de \
--cc=eranian@google.com \
--cc=fweisbec@gmail.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@gmail.com \
--cc=paulus@samba.org \
--cc=peterz@infradead.org \
/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®