Re: [PATCH v2 3/9] perf pmu: Use file system cache to optimize sysfs access

2019-10-23 Thread Jiri Olsa
On Sun, Oct 20, 2019 at 10:51:56AM -0700, Andi Kleen wrote: SNIP > @@ -92,8 +93,12 @@ static int pmu_format(const char *name, struct list_head > *format) > snprintf(path, PATH_MAX, >"%s" EVENT_SOURCE_DEVICE_PATH "%s/format", sysfs, name); > > - if (stat(path, &st) < 0

[PATCH v2 3/9] perf pmu: Use file system cache to optimize sysfs access

2019-10-20 Thread Andi Kleen
From: Andi Kleen pmu.c does a lot of redundant /sys accesses while parsing aliases and probing for PMUs. On large systems with a lot of PMUs this can get expensive (>2s): % time seconds usecs/call callserrors syscall -- --- --- - - ---