linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Shang XiaoJing <shangxiaojing@huawei.com>
Cc: peterz@infradead.org, mingo@redhat.com, mark.rutland@arm.com,
	alexander.shishkin@linux.intel.com, jolsa@kernel.org,
	namhyung@kernel.org, linux-perf-users@vger.kernel.org
Subject: Re: [PATCH 2/4] perf stat: Merge cases in process_evlist
Date: Thu, 22 Sep 2022 20:33:16 +0100	[thread overview]
Message-ID: <Yyy4fJNyxxXVzHyv@kernel.org> (raw)
In-Reply-To: <20220922141438.22487-3-shangxiaojing@huawei.com>

Em Thu, Sep 22, 2022 at 10:14:36PM +0800, Shang XiaoJing escreveu:
> As two cases in process_evlist has same behavior, merge these cases.

Applied.

Added the patch below, see:

include/linux/compiler_attributes.h and
tools/include/linux/compiler-gcc.h.

- Arnaldo

Commiter notes:

Added __fallthrough, the kernel has "fallthrough", we need to make
tools/ use it.

---

diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index e10595f649bcb2b4..7b8e901bce101b63 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -662,6 +662,7 @@ static void process_evlist(struct evlist *evlist, unsigned int interval)
 	if (evlist__ctlfd_process(evlist, &cmd) > 0) {
 		switch (cmd) {
 		case EVLIST_CTL_CMD_ENABLE:
+			__fallthrough;
 		case EVLIST_CTL_CMD_DISABLE:
 			if (interval)
 				process_interval();
 
> Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
> ---
>  tools/perf/builtin-stat.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
> index e05fe72c1d87..e10595f649bc 100644
> --- a/tools/perf/builtin-stat.c
> +++ b/tools/perf/builtin-stat.c
> @@ -662,9 +662,6 @@ static void process_evlist(struct evlist *evlist, unsigned int interval)
>  	if (evlist__ctlfd_process(evlist, &cmd) > 0) {
>  		switch (cmd) {
>  		case EVLIST_CTL_CMD_ENABLE:
> -			if (interval)
> -				process_interval();
> -			break;
>  		case EVLIST_CTL_CMD_DISABLE:
>  			if (interval)
>  				process_interval();
> -- 
> 2.17.1

-- 

- Arnaldo

  reply	other threads:[~2022-09-22 19:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-22 14:14 [PATCH 0/4] perf: Some clean up Shang XiaoJing
2022-09-22 14:14 ` [PATCH 1/4] perf genelf: Fix error code in jit_write_elf() Shang XiaoJing
2022-09-22 19:27   ` Arnaldo Carvalho de Melo
2022-09-22 14:14 ` [PATCH 2/4] perf stat: Merge cases in process_evlist Shang XiaoJing
2022-09-22 19:33   ` Arnaldo Carvalho de Melo [this message]
2022-09-22 14:14 ` [PATCH 3/4] perf top: Fix error code in cmd_top() Shang XiaoJing
2022-09-22 14:14 ` [PATCH 4/4] perf stat: Clean redundant if in process_evlist Shang XiaoJing
2022-09-22 19:54   ` Arnaldo Carvalho de Melo
2022-09-22 22:50     ` Ian Rogers
2022-09-26 20:32       ` 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=Yyy4fJNyxxXVzHyv@kernel.org \
    --to=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=jolsa@kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=shangxiaojing@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).