From: Namhyung Kim <namhyung.kim@lge.com>
To: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>,
Paul Mackerras <paulus@samba.org>, Ingo Molnar <mingo@redhat.com>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/3] Revert 'perf evlist: Fix creation of cpu map'
Date: Thu, 17 May 2012 18:03:37 +0900 [thread overview]
Message-ID: <87pqa318nq.fsf@sejong.aot.lge.com> (raw)
In-Reply-To: <87txzf18yb.fsf@sejong.aot.lge.com> (Namhyung Kim's message of "Thu, 17 May 2012 17:57:16 +0900")
Hi,
On Thu, 17 May 2012 17:57:16 +0900, Namhyung Kim wrote:
> On Wed, 16 May 2012 12:26:19 -0300, Arnaldo Carvalho de Melo wrote:
>> I'm applying it, but while trying to figure out if the logic was right I
>> tried:
>>
>> perf top -C 0 -u acme
>>
>> To check what is that this user is doing on that CPU, and its not
>> possible :-\
>>
>> UID switch overriding CPU!
>>
>
> Maybe I need to rethink about it since I wasn't aware of the
> per-task-per-cpu events at that time.
>
> AFAIK the uid switch is basically a same thing as pid/tid switch, so
> your complain should be extended to them too. And I think we can remove
> the check from perf_target__validate(). But before that something like
> below is needed also IMHO:
>
After applying the patch below and removing the check, I got:
namhyung@sejong:perf$ sudo ./perf top -C0 -u namhyung -s cpu,dso,sym --stdio
PerfTop: 5 irqs/sec kernel:100.0% exact: 0.0% [1000Hz cycles], (uid: namhyung, CPU: 0)
-------------------------------------------------------------------------------------------------------------------------------
91.67% 1 [kernel] [k] dequeue_entity
7.25% 5 [kernel] [k] schedule_hrtimeout_range
1.01% 1 [kernel] [k] __perf_event_task_sched
0.06% 5 [kernel] [k] native_write_msr_safe
0.01% 1 [kernel] [k] native_write_msr_safe
Failed to open /tmp/perf-1340.map, continuing without symbols
So definitely it needs more work...
Thanks,
Namhyung
>
> diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
> index ebcd15883ab8..8e3cf429dd18 100644
> --- a/tools/perf/builtin-top.c
> +++ b/tools/perf/builtin-top.c
> @@ -900,6 +900,9 @@ static void perf_top__start_counters(struct perf_top *top)
> attr->read_format |= PERF_FORMAT_ID;
> }
>
> + if (perf_target__has_cpu(&top->target))
> + attr->sample_type |= PERF_SAMPLE_CPU;
> +
> if (symbol_conf.use_callchain)
> attr->sample_type |= PERF_SAMPLE_CALLCHAIN;
>
> diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
> index d7a2b4b9801d..d26b8fe0abd1 100644
> --- a/tools/perf/util/evsel.c
> +++ b/tools/perf/util/evsel.c
> @@ -107,7 +107,7 @@ void perf_evsel__config(struct perf_evsel *evsel, struct perf_record_opts *opts,
> if (opts->call_graph)
> attr->sample_type |= PERF_SAMPLE_CALLCHAIN;
>
> - if (opts->target.system_wide)
> + if (perf_target__has_cpu(&opts->target))
> attr->sample_type |= PERF_SAMPLE_CPU;
>
> if (opts->period)
next prev parent reply other threads:[~2012-05-17 9:05 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-16 9:45 [PATCH 1/3] perf target: Rename functions to avoid double negation Namhyung Kim
2012-05-16 9:45 ` [PATCH 2/3] Revert 'perf evlist: Fix creation of cpu map' Namhyung Kim
2012-05-16 15:26 ` Arnaldo Carvalho de Melo
2012-05-17 8:57 ` Namhyung Kim
2012-05-17 9:03 ` Namhyung Kim [this message]
2012-05-21 7:38 ` [tip:perf/core] " tip-bot for Namhyung Kim
2012-05-16 9:45 ` [PATCH 3/3] perf target: Add need_mmap field Namhyung Kim
2012-05-16 15:28 ` Arnaldo Carvalho de Melo
2012-05-16 15:32 ` David Ahern
2012-05-16 15:50 ` Arnaldo Carvalho de Melo
2012-05-21 7:39 ` [tip:perf/core] perf target: Add uses_mmap field tip-bot for Namhyung Kim
2012-05-21 7:37 ` [tip:perf/core] perf target: Rename functions to avoid double negation tip-bot for Namhyung Kim
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=87pqa318nq.fsf@sejong.aot.lge.com \
--to=namhyung.kim@lge.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@ghostprotocols.net \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=paulus@samba.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
Powered by JetHome