All of lore.kernel.org
 help / color / mirror / Atom feed
From: zhangmengting <zhangmengting@huawei.com>
To: David Ahern <dsahern@gmail.com>,
	<linux-perf-users@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Cc: <peterz@infradead.org>, <mingo@redhat.com>, <acme@kernel.org>,
	<alexander.shishkin@linux.intel.com>, <ak@linux.intel.com>,
	<jolsa@kernel.org>, <namhyung@kernel.org>,
	<dsa@cumulusnetworks.com>, <wangnan0@huawei.com>,
	<huawei.libin@huawei.com>
Subject: Re: [PATCH] perf script: Add option to display guest samples in host
Date: Mon, 23 Oct 2017 14:40:59 +0800	[thread overview]
Message-ID: <c656c7fc-8b32-2a32-bbc9-58aa13ac9d39@huawei.com> (raw)
In-Reply-To: <a1e7fa6d-a427-9e0f-baad-4853d63078cb@gmail.com>

Hi all,
For sched_switch tracepoint, I guess maybe it would be more reasonable 
to show guest samples together with host samples by default, instead of 
setting an option to display guest samples when we meet with this 
confused situation.
To take care of this issue, the code should be changed as below:

diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index 0c977b6..dcfab00 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -1557,7 +1557,7 @@ static int process_sample_event(struct perf_tool 
*tool,
          return -1;
      }

-    if (al.filtered)
+    if (al.filtered && !(strcmp(evsel->name, "sched:sched_switch")== 0 
&& perf_host &&(al.filtered & (1 << HIST_FILTER__GUEST))))
          goto out_put;

      if (cpu_list && !test_bit(sample->cpu, cpu_bitmap))

Right?

Thanks,
Mengting Zhang


On 2017/10/18 22:37, David Ahern wrote:
> On 10/18/17 1:09 AM, Mengting Zhang wrote:
>> @@ -2771,6 +2772,8 @@ int cmd_script(int argc, const char **argv)
>>   		    "Show context switch events (if recorded)"),
>>   	OPT_BOOLEAN('\0', "show-namespace-events", &script.show_namespace_events,
>>   		    "Show namespace events (if recorded)"),
>> +	OPT_BOOLEAN('\0', "show-guest-samples", &script.show_guest_samples,
>> +		    "Show guest samples (if recorded)"),
>>   	OPT_BOOLEAN('f', "force", &symbol_conf.force, "don't complain, do it"),
>>   	OPT_INTEGER(0, "max-blocks", &max_blocks,
>>   		    "Maximum number of code blocks to dump with brstackinsn"),
> At this point we need a 'show-all' option.
>
> .
>

WARNING: multiple messages have this Message-ID (diff)
From: zhangmengting <zhangmengting@huawei.com>
To: David Ahern <dsahern@gmail.com>,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: peterz@infradead.org, mingo@redhat.com, acme@kernel.org,
	alexander.shishkin@linux.intel.com, ak@linux.intel.com,
	jolsa@kernel.org, namhyung@kernel.org, dsa@cumulusnetworks.com,
	wangnan0@huawei.com, huawei.libin@huawei.com
Subject: Re: [PATCH] perf script: Add option to display guest samples in host
Date: Mon, 23 Oct 2017 14:40:59 +0800	[thread overview]
Message-ID: <c656c7fc-8b32-2a32-bbc9-58aa13ac9d39@huawei.com> (raw)
In-Reply-To: <a1e7fa6d-a427-9e0f-baad-4853d63078cb@gmail.com>

Hi all,
For sched_switch tracepoint, I guess maybe it would be more reasonable 
to show guest samples together with host samples by default, instead of 
setting an option to display guest samples when we meet with this 
confused situation.
To take care of this issue, the code should be changed as below:

diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index 0c977b6..dcfab00 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -1557,7 +1557,7 @@ static int process_sample_event(struct perf_tool 
*tool,
          return -1;
      }

-    if (al.filtered)
+    if (al.filtered && !(strcmp(evsel->name, "sched:sched_switch")== 0 
&& perf_host &&(al.filtered & (1 << HIST_FILTER__GUEST))))
          goto out_put;

      if (cpu_list && !test_bit(sample->cpu, cpu_bitmap))

Right?

Thanks,
Mengting Zhang


On 2017/10/18 22:37, David Ahern wrote:
> On 10/18/17 1:09 AM, Mengting Zhang wrote:
>> @@ -2771,6 +2772,8 @@ int cmd_script(int argc, const char **argv)
>>   		    "Show context switch events (if recorded)"),
>>   	OPT_BOOLEAN('\0', "show-namespace-events", &script.show_namespace_events,
>>   		    "Show namespace events (if recorded)"),
>> +	OPT_BOOLEAN('\0', "show-guest-samples", &script.show_guest_samples,
>> +		    "Show guest samples (if recorded)"),
>>   	OPT_BOOLEAN('f', "force", &symbol_conf.force, "don't complain, do it"),
>>   	OPT_INTEGER(0, "max-blocks", &max_blocks,
>>   		    "Maximum number of code blocks to dump with brstackinsn"),
> At this point we need a 'show-all' option.
>
> .
>

  reply	other threads:[~2017-10-23  6:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-18  7:09 [PATCH] perf script: Add option to display guest samples in host Mengting Zhang
2017-10-18  7:09 ` Mengting Zhang
2017-10-18 14:37 ` David Ahern
2017-10-23  6:40   ` zhangmengting [this message]
2017-10-23  6:40     ` zhangmengting

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=c656c7fc-8b32-2a32-bbc9-58aa13ac9d39@huawei.com \
    --to=zhangmengting@huawei.com \
    --cc=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=dsa@cumulusnetworks.com \
    --cc=dsahern@gmail.com \
    --cc=huawei.libin@huawei.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=wangnan0@huawei.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.