Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:15.5:Update
perf.16341
perf-bpf-loader-add-missing-for-key_scan_pos.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File perf-bpf-loader-add-missing-for-key_scan_pos.patch of Package perf.16341
From: Wang ShaoBo <bobo.shaobowang@huawei.com> Date: Wed, 20 May 2020 11:32:16 +0800 Subject: perf bpf-loader: Add missing '*' for key_scan_pos Git-commit: 04f9bf2bac72480ca1d289b751b956dd1707a5d5 References: git-fixes key_scan_pos is a pointer for getting scan position in bpf__obj_config_map() for each BPF map configuration term, but it's misused when error not happened. Committer notes: The point is that the only user of this is: tools/perf/util/parse-events.c err = bpf__config_obj(obj, term, parse_state->evlist, &error_pos); if (err) bpf__strerror_config_obj(obj, term, parse_state->evlist, &error_pos, err, errbuf, sizeof(errbuf)); And then: int bpf__strerror_config_obj(struct bpf_object *obj __maybe_unused, struct parse_events_term *term __maybe_unused, struct evlist *evlist __maybe_unused, int *error_pos __maybe_unused, int err, char *buf, size_t size) { bpf__strerror_head(err, buf, size); bpf__strerror_entry(BPF_LOADER_ERRNO__OBJCONF_MAP_TYPE, "Can't use this config term with this map type"); bpf__strerror_end(buf, size); return 0; } So this is infrastructure that Wang Nan put in place for providing better error messages but that he ended up not using, so I'll apply the fix, its correct even not fixing any real problem at this time. Fixes: 066dacbf2a32 ("perf bpf: Add API to set values to map entries in a bpf object") Signed-off-by: Wang ShaoBo <bobo.shaobowang@huawei.com> Acked-by: Jiri Olsa <jolsa@redhat.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Cheng Jian <cj.chengjian@huawei.com> Cc: Hanjun Guo <guohanjun@huawei.com> Cc: Li Bin <huawei.libin@huawei.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Wang Nan <wangnan0@huawei.com> Cc: Xie XiuQi <xiexiuqi@huawei.com> Cc: bpf@vger.kernel.org Link: http://lore.kernel.org/lkml/20200520033216.48310-1-bobo.shaobowang@huawei.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Acked-by: Tony Jones <tonyj@suse.de> --- tools/perf/util/bpf-loader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/util/bpf-loader.c b/tools/perf/util/bpf-loader.c index 83bfb8768235..2feb751516ab 100644 --- a/tools/perf/util/bpf-loader.c +++ b/tools/perf/util/bpf-loader.c @@ -1225,7 +1225,7 @@ bpf__obj_config_map(struct bpf_object *obj, out: free(map_name); if (!err) - key_scan_pos += strlen(map_opt); + *key_scan_pos += strlen(map_opt); return err; }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor