Logo
Explore Help
Register Sign In
leandrof/linux
1
0
Fork 0
You've already forked linux
Code Issues Pull Requests Packages Projects Releases Wiki Activity
Files
fc42aa47bfdef6a0a6593de9364db354b5891d2c
linux/tools/perf/util/fncache.h

8 lines
126 B
C
Raw Normal View History

perf pmu: Use file system cache to optimize sysfs access 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 calls errors syscall ------ ----------- ----------- --------- --------- ---------------- 27.25 1.227847 8 160888 16976 openat 26.42 1.190481 7 164224 164077 stat Add a cache to remember if specific file names exist or don't exist, which eliminates most of this overhead. Also optimize some stat() calls to be slightly cheaper access() Resulting in: 0.18 0.004166 2 1851 305 open 0.08 0.001970 2 829 622 access Signed-off-by: Andi Kleen <ak@linux.intel.com> Acked-by: Jiri Olsa <jolsa@kernel.org> Link: http://lore.kernel.org/lkml/20191121001522.180827-2-andi@firstfloor.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2019-11-20 16:15:11 -08:00
#ifndef _FCACHE_H
#define _FCACHE_H 1
unsigned shash(const unsigned char *s);
bool file_available(const char *name);
#endif
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.25.1 Page: 462ms Template: 1ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API