lkml.org 
[lkml]   [2021]   [Jun]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] perf stat: Fix error return code in bperf__load()
Em Mon, May 17, 2021 at 04:12:54PM +0800, Yu Kuai escreveu:
> Fix to return a negative error code from the error handling
> case instead of 0, as done elsewhere in this function.
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Yu Kuai <yukuai3@huawei.com>

Applied, but I had to add Song to the CC list and also add this line:

Fixes: 7fac83aaf2eecc9e ("perf stat: Introduce 'bperf' to share hardware PMCs with BPF")

So that the stable@kernel.org folks can get this auto-collected.

Perhaps you guys can make Hulk do that as well? :-)

Thanks,

- Arnaldo

> ---
> tools/perf/util/bpf_counter.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/tools/perf/util/bpf_counter.c b/tools/perf/util/bpf_counter.c
> index ddb52f748c8e..843b20aa6688 100644
> --- a/tools/perf/util/bpf_counter.c
> +++ b/tools/perf/util/bpf_counter.c
> @@ -522,6 +522,7 @@ static int bperf__load(struct evsel *evsel, struct target *target)
> evsel->bperf_leader_link_fd = bpf_link_get_fd_by_id(entry.link_id);
> if (evsel->bperf_leader_link_fd < 0 &&
> bperf_reload_leader_program(evsel, attr_map_fd, &entry))
> + err = -1;
> goto out;
>
> /*
> @@ -550,6 +551,7 @@ static int bperf__load(struct evsel *evsel, struct target *target)
> /* Step 2: load the follower skeleton */
> evsel->follower_skel = bperf_follower_bpf__open();
> if (!evsel->follower_skel) {
> + err = -1;
> pr_err("Failed to open follower skeleton\n");
> goto out;
> }
> --
> 2.25.4
>

--

- Arnaldo

\
 
 \ /
  Last update: 2021-06-01 15:53    [W:0.079 / U:0.172 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site