Re: [PATCH v3 3/9] perf mem: Support new memory event PERF_MEM_EVENTS__LOAD_STORE

Jiri Olsa
2020-10-31T20:23:47Z

On Wed, Oct 28, 2020 at 02:38:07PM +0800, Leo Yan wrote:

SNIP

> struct stat st;
>
> + /*
> + * If the event entry isn't valid, skip initialization
> + * and "e->supported" will keep false.
> + */
> + if (!e->tag)
> + continue;
> +
> scnprintf(path, PATH_MAX, "%s/devices/%s",
> mnt, e->sysfs_name);
>
> @@ -123,7 +134,7 @@ void perf_mem_events__list(void)
> struct perf_mem_event *e = perf_mem_events__ptr(j);
>
> fprintf(stderr, "%-13s%-*s%s\n",
> - e->tag,
> + e->tag ? e->tag : "",

nit, could be: e->tag ?: "",

jirka

> verbose > 0 ? 25 : 0,
> verbose > 0 ? perf_mem_events__name(j) : "",
> e->supported ? ": available" : "");
> diff --git a/tools/perf/util/mem-events.h b/tools/perf/util/mem-events.h
> index 726a9c8103e4..5ef178278909 100644
> --- a/tools/perf/util/mem-events.h
> +++ b/tools/perf/util/mem-events.h
> @@ -28,6 +28,7 @@ struct mem_info {
> enum {
> PERF_MEM_EVENTS__LOAD,
> PERF_MEM_EVENTS__STORE,
> + PERF_MEM_EVENTS__LOAD_STORE,
> PERF_MEM_EVENTS__MAX,
> };
>
> --
> 2.17.1
>