summaryrefslogtreecommitdiff
path: root/tools/perf
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2026-01-27 01:15:47 -0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2026-01-27 01:54:47 -0300
commitb42868624c7d00206f77d19a6fbfea73a44ff6f2 (patch)
tree5c8fcefaaeac61f20aabf04e9cf39e759f23d384 /tools/perf
parent23262369e650c9995505eb4f69f16449467e6bfe (diff)
perf metricgroup: Constify variables storing the result of strchr() on const tables
As newer glibcs will propagate the const attribute of the searched table to its return. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf')
-rw-r--r--tools/perf/util/metricgroup.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/tools/perf/util/metricgroup.c b/tools/perf/util/metricgroup.c
index 25c75fdbfc52..40a1e14de418 100644
--- a/tools/perf/util/metricgroup.c
+++ b/tools/perf/util/metricgroup.c
@@ -367,7 +367,7 @@ static int setup_metric_events(const char *pmu, struct hashmap *ids,
static bool match_metric_or_groups(const char *metric_or_groups, const char *sought)
{
int len;
- char *m;
+ const char *m;
if (!sought)
return false;
@@ -450,11 +450,10 @@ static const char *code_characters = ",-=@";
static int encode_metric_id(struct strbuf *sb, const char *x)
{
- char *c;
int ret = 0;
for (; *x; x++) {
- c = strchr(code_characters, *x);
+ const char *c = strchr(code_characters, *x);
if (c) {
ret = strbuf_addch(sb, '!');
if (ret)