mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-22 06:32:08 +00:00
perf tools: Parse the pmu event prefix and suffix
There are two types of event formats for PMU events. E.g. el-abort OR cpu/el-abort/. However, the lexer mistakenly recognizes the simple style format as two events. The parse_events_pmu_check function uses bsearch to search the name in known pmu event list. It can tell the lexer that the name is a PE_NAME or a PMU event name prefix or a PMU event name suffix. All these information will be used for accurately parsing kernel PMU events. The pmu events list will be read from sysfs at runtime. Note: Currently, the patch only want to handle the PMU event name as "a-b" and "a". The only exception, "stalled-cycles-frontend" and "stalled-cycles-fronted", are already hardcoded in lexer. Signed-off-by: Kan Liang <kan.liang@intel.com> Acked-by: Jiri Olsa <jolsa@redhat.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Jiri Olsa <jolsa@redhat.com> Link: http://lkml.kernel.org/r/1412694532-23391-3-git-send-email-kan.liang@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
42f60c2d63
commit
dcb4e1022b
4 changed files with 141 additions and 10 deletions
|
@ -35,6 +35,18 @@ extern int parse_filter(const struct option *opt, const char *str, int unset);
|
|||
|
||||
#define EVENTS_HELP_MAX (128*1024)
|
||||
|
||||
enum perf_pmu_event_symbol_type {
|
||||
PMU_EVENT_SYMBOL_ERR, /* not a PMU EVENT */
|
||||
PMU_EVENT_SYMBOL, /* normal style PMU event */
|
||||
PMU_EVENT_SYMBOL_PREFIX, /* prefix of pre-suf style event */
|
||||
PMU_EVENT_SYMBOL_SUFFIX, /* suffix of pre-suf style event */
|
||||
};
|
||||
|
||||
struct perf_pmu_event_symbol {
|
||||
char *symbol;
|
||||
enum perf_pmu_event_symbol_type type;
|
||||
};
|
||||
|
||||
enum {
|
||||
PARSE_EVENTS__TERM_TYPE_NUM,
|
||||
PARSE_EVENTS__TERM_TYPE_STR,
|
||||
|
@ -95,6 +107,8 @@ int parse_events_add_breakpoint(struct list_head *list, int *idx,
|
|||
void *ptr, char *type);
|
||||
int parse_events_add_pmu(struct list_head *list, int *idx,
|
||||
char *pmu , struct list_head *head_config);
|
||||
enum perf_pmu_event_symbol_type
|
||||
perf_pmu__parse_check(const char *name);
|
||||
void parse_events__set_leader(char *name, struct list_head *list);
|
||||
void parse_events_update_lists(struct list_head *list_event,
|
||||
struct list_head *list_all);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue