The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Adrian Hunter <adrian.hunter@intel.com>
To: Alexander Pantyukhin <apantykhin@gmail.com>
Cc: mingo@redhat.com, namhyung@kernel.org, jolsa@kernel.org,
	acme@kernel.org, akpm@linux-foundation.org,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] tools:perf:scripts:python:intel-pt-events del unusedvar
Date: Mon, 16 Jan 2023 07:15:01 +0200	[thread overview]
Message-ID: <ae03d3af-02de-0d36-4680-c4ad934da77d@intel.com> (raw)
In-Reply-To: <20230114130533.2877-1-apantykhin@gmail.com>

On 14/01/23 15:05, Alexander Pantyukhin wrote:
> The event_attr is never used later, the var is ok be deleted.
> Additional code simplification is to substitute string slice comparison
> with "substring" function. This case no need to know the length specific
> words.
> 
> Signed-off-by: Alexander Pantyukhin <apantykhin@gmail.com>

Acked-by: Adrian Hunter <adrian.hunter@intel.com>

> ---
>  tools/perf/scripts/python/intel-pt-events.py | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/tools/perf/scripts/python/intel-pt-events.py b/tools/perf/scripts/python/intel-pt-events.py
> index 08862a2582f4..dfd566369ca4 100644
> --- a/tools/perf/scripts/python/intel-pt-events.py
> +++ b/tools/perf/scripts/python/intel-pt-events.py
> @@ -340,7 +340,6 @@ def print_srccode(comm, param_dict, sample, symbol, dso, with_insn):
>  	print(start_str, src_str)
>  
>  def do_process_event(param_dict):
> -	event_attr = param_dict["attr"]
>  	sample	   = param_dict["sample"]
>  	raw_buf	   = param_dict["raw_buf"]
>  	comm	   = param_dict["comm"]
> @@ -349,6 +348,7 @@ def do_process_event(param_dict):
>  	# callchain  = param_dict["callchain"]
>  	# brstack    = param_dict["brstack"]
>  	# brstacksym = param_dict["brstacksym"]
> +	# event_attr = param_dict["attr"]
>  
>  	# Symbol and dso info are not always resolved
>  	dso    = get_optional(param_dict, "dso")
> @@ -359,13 +359,13 @@ def do_process_event(param_dict):
>  		print(glb_switch_str[cpu])
>  		del glb_switch_str[cpu]
>  
> -	if name[0:12] == "instructions":
> +	if name.startswith("instructions"):
>  		if glb_src:
>  			print_srccode(comm, param_dict, sample, symbol, dso, True)
>  		else:
>  			print_instructions_start(comm, sample)
>  			print_common_ip(param_dict, sample, symbol, dso)
> -	elif name[0:8] == "branches":
> +	elif name.startswith("branches"):
>  		if glb_src:
>  			print_srccode(comm, param_dict, sample, symbol, dso, False)
>  		else:


  reply	other threads:[~2023-01-16  5:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-14 13:05 [PATCH v2] tools:perf:scripts:python:intel-pt-events del unusedvar Alexander Pantyukhin
2023-01-16  5:15 ` Adrian Hunter [this message]
2023-04-12 15:20   ` Arnaldo Carvalho de Melo

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=ae03d3af-02de-0d36-4680-c4ad934da77d@intel.com \
    --to=adrian.hunter@intel.com \
    --cc=acme@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=apantykhin@gmail.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 \
    /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