Skip to content

Commit

Permalink
perf evsel: Move config terms to a separate header
Browse files Browse the repository at this point in the history
Further reducing the size of util/evsel.h.

Cc: Adrian Hunter <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Namhyung Kim <[email protected]>
Link: https://lkml.kernel.org/n/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
  • Loading branch information
acmel committed Sep 25, 2019
1 parent bd70462 commit 95be9d1
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 43 deletions.
1 change: 1 addition & 0 deletions tools/perf/arch/arm/util/cs-etm.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "../../util/event.h"
#include "../../util/evlist.h"
#include "../../util/evsel.h"
#include "../../util/evsel_config.h"
#include "../../util/pmu.h"
#include "../../util/cs-etm.h"
#include <internal/lib.h> // page_size
Expand Down
1 change: 1 addition & 0 deletions tools/perf/builtin-top.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "util/dso.h"
#include "util/evlist.h"
#include "util/evsel.h"
#include "util/evsel_config.h"
#include "util/event.h"
#include "util/machine.h"
#include "util/map.h"
Expand Down
1 change: 1 addition & 0 deletions tools/perf/util/evsel.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "counts.h"
#include "event.h"
#include "evsel.h"
#include "util/evsel_config.h"
#include "util/evsel_fprintf.h"
#include "evlist.h"
#include <perf/cpumap.h>
Expand Down
43 changes: 0 additions & 43 deletions tools/perf/util/evsel.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,49 +12,6 @@
#include "symbol_conf.h"
#include <internal/cpumap.h>

/*
* The 'struct perf_evsel_config_term' is used to pass event
* specific configuration data to perf_evsel__config routine.
* It is allocated within event parsing and attached to
* perf_evsel::config_terms list head.
*/
enum term_type {
PERF_EVSEL__CONFIG_TERM_PERIOD,
PERF_EVSEL__CONFIG_TERM_FREQ,
PERF_EVSEL__CONFIG_TERM_TIME,
PERF_EVSEL__CONFIG_TERM_CALLGRAPH,
PERF_EVSEL__CONFIG_TERM_STACK_USER,
PERF_EVSEL__CONFIG_TERM_INHERIT,
PERF_EVSEL__CONFIG_TERM_MAX_STACK,
PERF_EVSEL__CONFIG_TERM_MAX_EVENTS,
PERF_EVSEL__CONFIG_TERM_OVERWRITE,
PERF_EVSEL__CONFIG_TERM_DRV_CFG,
PERF_EVSEL__CONFIG_TERM_BRANCH,
PERF_EVSEL__CONFIG_TERM_PERCORE,
PERF_EVSEL__CONFIG_TERM_AUX_OUTPUT,
};

struct perf_evsel_config_term {
struct list_head list;
enum term_type type;
union {
u64 period;
u64 freq;
bool time;
char *callgraph;
char *drv_cfg;
u64 stack_user;
int max_stack;
bool inherit;
bool overwrite;
char *branch;
unsigned long max_events;
bool percore;
bool aux_output;
} val;
bool weak;
};

struct bpf_object;
struct cgroup;
struct perf_counts;
Expand Down
50 changes: 50 additions & 0 deletions tools/perf/util/evsel_config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// SPDX-License-Identifier: GPL-2.0
#ifndef __PERF_EVSEL_CONFIG_H
#define __PERF_EVSEL_CONFIG_H 1

#include <linux/types.h>
#include <stdbool.h>

/*
* The 'struct perf_evsel_config_term' is used to pass event
* specific configuration data to perf_evsel__config routine.
* It is allocated within event parsing and attached to
* perf_evsel::config_terms list head.
*/
enum evsel_term_type {
PERF_EVSEL__CONFIG_TERM_PERIOD,
PERF_EVSEL__CONFIG_TERM_FREQ,
PERF_EVSEL__CONFIG_TERM_TIME,
PERF_EVSEL__CONFIG_TERM_CALLGRAPH,
PERF_EVSEL__CONFIG_TERM_STACK_USER,
PERF_EVSEL__CONFIG_TERM_INHERIT,
PERF_EVSEL__CONFIG_TERM_MAX_STACK,
PERF_EVSEL__CONFIG_TERM_MAX_EVENTS,
PERF_EVSEL__CONFIG_TERM_OVERWRITE,
PERF_EVSEL__CONFIG_TERM_DRV_CFG,
PERF_EVSEL__CONFIG_TERM_BRANCH,
PERF_EVSEL__CONFIG_TERM_PERCORE,
PERF_EVSEL__CONFIG_TERM_AUX_OUTPUT,
};

struct perf_evsel_config_term {
struct list_head list;
enum evsel_term_type type;
union {
u64 period;
u64 freq;
bool time;
char *callgraph;
char *drv_cfg;
u64 stack_user;
int max_stack;
bool inherit;
bool overwrite;
char *branch;
unsigned long max_events;
bool percore;
bool aux_output;
} val;
bool weak;
};
#endif // __PERF_EVSEL_CONFIG_H
1 change: 1 addition & 0 deletions tools/perf/util/parse-events.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include "asm/bug.h"
#include "util/parse-branch-options.h"
#include "metricgroup.h"
#include "util/evsel_config.h"
#include "util/mmap.h"

#define MAX_NAME_LEN 100
Expand Down

0 comments on commit 95be9d1

Please sign in to comment.