diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index 66d235e0cc98f2050187a7982b0135d2d1c21946..a031ee1f54f6d97dbf2f3cae12b293d1fd2f1f71 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c @@ -308,7 +308,7 @@ int parse_events_add_cache(struct list_head **list, int *idx, for (i = 0; (i < 2) && (op_result[i]); i++) { char *str = op_result[i]; - snprintf(name + n, MAX_NAME_LEN - n, "-%s", str); + n += snprintf(name + n, MAX_NAME_LEN - n, "-%s", str); if (cache_op == -1) { cache_op = parse_aliases(str, perf_evsel__hw_cache_op,