Projectname
large_stringclasses
15 values
Filepath
large_stringlengths
4
106
⌀
Function
large_stringlengths
11
3.45k
Label
list
Linux Kernel
tools/perf/util/machine.c
static void ip__resolve_ams(struct thread *thread, struct addr_map_symbol *ams, u64 ip) { struct addr_location al; memset(&al, 0, sizeof(al)); thread__find_cpumode_addr_location(thread, ip, &al); ams->addr = ip; ams->al_addr = al.addr; ams->al_level = al.level; ams->ms.maps ...
[ 1, 0 ]
Linux Kernel
tools/perf/util/machine.c
static void ip__resolve_data(struct thread *thread, u8 m, struct addr_map_symbol *ams, u64 addr, u64 phys_addr, u64 daddr_page_size) { struct addr_location al; memset(&al, 0, sizeof(al)); thread__find_symbol(thread, m, addr, &al); ams->addr = addr; ...
[ 1, 0 ]
Linux Kernel
tools/perf/util/machine.c
static int remove_loops(struct branch_entry *l, int nr, struct iterations *iter) { int i, j, off; unsigned char chash[CHASHSZ]; memset(chash, NO_ENTRY, sizeof(chash)); BUG_ON(PERF_MAX_BRANCH_DEPTH > 255); for (i = 0; i < nr; i++) { int h = hash_64(l[i].from, CHASHBITS) % CHASHSZ...
[ 1, 0 ]
Linux Kernel
tools/perf/util/machine.c
int machine__for_each_thread(struct machine *machine, int (*fn)(struct thread *thread, void *p), void *priv) { struct threads *threads; struct rb_node *nd; struct thread *thread; int rc = 0; int i; for (i = 0; i < THREADS__TABLE_SIZE; i++) { th...
[ 0, 0 ]
Linux Kernel
tools/perf/util/machine.c
pid_t machine__get_current_tid(struct machine *machine, int cpu) { if (cpu < 0 || (size_t)cpu >= machine->current_tid_sz) return -1; return machine->current_tid[cpu]; }
[ 0, 0 ]
Linux Kernel
tools/perf/util/machine.c
bool machine__is(struct machine *machine, const char *arch) { return machine && !strcmp(perf_env__raw_arch(machine->env), arch); }
[ 0, 0 ]
Linux Kernel
tools/perf/util/machine.c
bool machine__normalized_is(struct machine *machine, const char *arch) { return machine && !strcmp(perf_env__arch(machine->env), arch); }
[ 0, 0 ]
Linux Kernel
tools/perf/util/machine.c
int machine__nr_cpus_avail(struct machine *machine) { return machine ? perf_env__nr_cpus_avail(machine->env) : 0; }
[ 0, 0 ]
Linux Kernel
tools/perf/util/machine.c
u8 machine__addr_cpumode(struct machine *machine, u8 cpumode, u64 addr) { u8 addr_cpumode = cpumode; bool kernel_ip; if (!machine->single_address_space) goto out; kernel_ip = machine__kernel_ip(machine, addr); switch (cpumode) { case PERF_RECORD_MISC_KERNEL: case PERF_RECORD_MISC_USER: addr_cpu...
[ 0, 0 ]
Linux Kernel
tools/perf/util/machine.c
int machine__for_each_dso(struct machine *machine, machine__dso_t fn, void *priv) { struct dso *pos; int err = 0; list_for_each_entry(pos, &machine->dsos.head, node) { if (fn(pos, machine, priv)) err = -1; } return err; }
[ 0, 0 ]
Linux Kernel
tools/perf/util/machine.h
static inline struct threads *machine__threads(struct machine *machine, pid_t tid) { return &machine->threads[(unsigned int)tid % THREADS__TABLE_SIZE]; }
[ 0, 0 ]
Linux Kernel
tools/perf/util/machine.h
static inline struct map *machine__kernel_map(struct machine *machine) { return machine->vmlinux_map; }
[ 0, 0 ]
Linux Kernel
tools/perf/util/machine.h
static inline struct maps *machine__kernel_maps(struct machine *machine) { return machine->kmaps; }
[ 0, 0 ]
Linux Kernel
tools/perf/util/machine.h
static inline bool machine__is_host(struct machine *machine) { return machine ? machine->pid == HOST_KERNEL_ID : false; }
[ 0, 0 ]
Linux Kernel
tools/perf/util/machine.h
static inline struct symbol * machine__find_kernel_symbol_by_name(struct machine *machine, const char *name, struct map **mapp) { return maps__find_symbol_by_name(machine->kmaps, name, mapp); }
[ 0, 0 ]
Linux Kernel
tools/perf/util/map.c
void map__init(struct map *map, u64 start, u64 end, u64 pgoff, struct dso *dso) { map->start = start; map->end = end; map->pgoff = pgoff; map->reloc = 0; map->dso = dso__get(dso); map->map_ip = map__map_ip; map->unmap_ip = map__unmap_ip; RB_CLEAR_NODE(&map->rb_node); map->erange_warned...
[ 0, 0 ]
Linux Kernel
tools/perf/util/map.c
bool __map__is_ool(const struct map *map) { return map->dso && map->dso->binary_type == DSO_BINARY_TYPE__OOL; }
[ 1, 0 ]
Linux Kernel
tools/perf/util/map.c
int map__fprintf_srcline(struct map *map, u64 addr, const char *prefix, FILE *fp) { int ret = 0; if (map && map->dso) { char *srcline = map__srcline(map, addr, NULL); if (strncmp(srcline, SRCLINE_UNKNOWN, strlen(SRCLINE_UNKNOWN)) != 0) ret = fprintf(fp, "%s%s", prefix, srcli...
[ 1, 0 ]
Linux Kernel
tools/perf/util/map.c
bool map__contains_symbol(const struct map *map, const struct symbol *sym) { u64 ip = map->unmap_ip(map, sym->start); return ip >= map->start && ip < map->end; }
[ 1, 0 ]
Linux Kernel
tools/perf/util/map.c
static struct map *__map__next(struct map *map) { struct rb_node *next = rb_next(&map->rb_node); if (next) return rb_entry(next, struct map, rb_node); return NULL; }
[ 0, 0 ]
Linux Kernel
tools/perf/util/map.h
static inline bool is_bpf_image(const char *name) { return strncmp(name, "bpf_trampoline_", sizeof("bpf_trampoline_") - 1) == 0 || strncmp(name, "bpf_dispatcher_", sizeof("bpf_dispatcher_") - 1) == 0; }
[ 1, 0 ]
Linux Kernel
tools/perf/util/map.h
static inline int is_anon_memory(const char *filename) { return !strcmp(filename, " !strncmp(filename, "/dev/zero", sizeof("/dev/zero") - 1) || !strncmp(filename, "/anon_hugepage", sizeof("/anon_hugepage") - 1); }
[ 1, 0 ]
Linux Kernel
tools/perf/util/maps.c
static void maps__init(struct maps *maps, struct machine *machine) { maps->entries = RB_ROOT; init_rwsem(&maps->lock); maps->machine = machine; maps->last_search_by_name = NULL; maps->nr_maps = 0; maps->maps_by_name = NULL; refcount_set(&maps->refcnt, 1); }
[ 0, 0 ]
Linux Kernel
tools/perf/util/maps.c
void maps__put(struct maps *maps) { if (maps && refcount_dec_and_test(&maps->refcnt)) maps__delete(maps); }
[ 0, 0 ]
Linux Kernel
tools/perf/util/maps.c
struct symbol *maps__find_symbol_by_name(struct maps *maps, const char *name, struct map **mapp) { struct symbol *sym; struct map *pos; down_read(&maps->lock); maps__for_each_entry(maps, pos) { sym = map__find_symbol_by_name(pos, name); if (sym == NULL) ...
[ 0, 0 ]
Linux Kernel
tools/perf/util/mem-events.c
__weak bool is_mem_loads_aux_event(struct evsel *leader __maybe_unused) { return false; }
[ 0, 0 ]
Linux Kernel
tools/perf/util/mem-events.c
int perf_mem_events__parse(const char *str) { char *tok, *saveptr = NULL; bool found = false; char *buf; int j; buf = malloc(strlen(str) + 1); if (!buf) return -ENOMEM; strcpy(buf, str); tok = strtok_r((char *)buf, ",", &saveptr); while (tok) { for (j = 0; j < PERF_MEM_EVENTS__MAX; j++) { ...
[ 1, 0 ]
Linux Kernel
tools/perf/util/mem-events.c
int perf_mem_events__init(void) { const char *mnt = sysfs__mount(); bool found = false; int j; if (!mnt) return -ENOENT; for (j = 0; j < PERF_MEM_EVENTS__MAX; j++) { struct perf_mem_event *e = perf_mem_events__ptr(j); struct perf_pmu *pmu; char sysfs_name[100]; if (!e->tag) contin...
[ 1, 0 ]
Linux Kernel
tools/perf/util/mem-events.c
static int perf_mem__op_scnprintf(char *out, size_t sz, struct mem_info *mem_info) { u64 op = PERF_MEM_LOCK_NA; int l; if (mem_info) op = mem_info->data_src.mem_op; if (op & PERF_MEM_OP_NA) l = scnprintf(out, sz, "N/A"); else if (op & PERF_MEM_OP_LOAD) l = scnp...
[ 0, 0 ]
Linux Kernel
tools/perf/util/memswap.c
void mem_bswap_64(void *src, int byte_size) { u64 *m = src; while (byte_size > 0) { *m = bswap_64(*m); byte_size -= sizeof(u64); ++m; } }
[ 1, 0 ]
Linux Kernel
tools/perf/util/metricgroup.c
struct metric_event *metricgroup__lookup(struct rblist *metric_events, struct evsel *evsel, bool create) { struct rb_node *nd; struct metric_event me = {.evsel = evsel}; if (!metric_events) return NULL; nd = rblist__find(metric_events, &me); if (nd) return c...
[ 0, 0 ]
Linux Kernel
tools/perf/util/metricgroup.c
void metricgroup__rblist_exit(struct rblist *metric_events) { rblist__exit(metric_events); }
[ 0, 0 ]
Linux Kernel
tools/perf/util/metricgroup.c
static struct metric *metric__new(const struct pmu_event *pe, const char *modifier, bool metric_no_group, int runtime, const char *user_requested_cpu_list, bool system_wide) { struc...
[ 1, 0 ]
Linux Kernel
tools/perf/util/metricgroup.c
static int setup_metric_events(struct hashmap *ids, struct evlist *metric_evlist, struct evsel ***out_metric_events) { struct evsel **metric_events; const char *metric_id; struct evsel *ev; size_t ids_size, matched_events, i; *out_metric_events = ...
[ 1, 0 ]
Linux Kernel
tools/perf/util/metricgroup.c
static int mep_cmp(struct rb_node *rb_node, const void *entry) { struct mep *a = container_of(rb_node, struct mep, nd); struct mep *b = (struct mep *)entry; return strcmp(a->name, b->name); }
[ 0, 0 ]
Linux Kernel
tools/perf/util/metricgroup.c
static struct rb_node *mep_new(struct rblist *rl __maybe_unused, const void *entry) { struct mep *me = malloc(sizeof(struct mep)); if (!me) return NULL; memcpy(me, entry, sizeof(struct mep)); me->name = strdup(me->name); if (!me->name) goto out_me; me->metrics = strl...
[ 1, 0 ]
Linux Kernel
tools/perf/util/metricgroup.c
static int metricgroup__print_pmu_event(const struct pmu_event *pe, bool metricgroups, char *filter, bool raw, bool details, struct rblist *groups, struct strl...
[ 1, 0 ]
Linux Kernel
tools/perf/util/metricgroup.c
static int metricgroup__print_sys_event_iter( const struct pmu_event *pe, const struct pmu_events_table *table __maybe_unused, void *data) { struct metricgroup_print_sys_idata *d = data; return metricgroup__print_pmu_event(pe, d->metricgroups, d->filter, d->raw, d->de...
[ 0, 0 ]
Linux Kernel
tools/perf/util/metricgroup.c
static int decode_metric_id(struct strbuf *sb, const char *x) { const char *orig = x; size_t i; char c; int ret; for (; *x; x++) { c = *x; if (*x == '!') { x++; i = *x - '0'; if (i > strlen(code_characters)) { pr_err("Bad metric-id encoding in: '%s'", orig); return ...
[ 0, 0 ]
Linux Kernel
tools/perf/util/metricgroup.c
static int decode_all_metric_ids(struct evlist *perf_evlist, const char *modifier) { struct evsel *ev; struct strbuf sb = STRBUF_INIT; char *cur; int ret = 0; evlist__for_each_entry(perf_evlist, ev) { if (!ev->metric_id) continue; ret = strbuf_setlen(&sb, 0); ...
[ 1, 0 ]
Linux Kernel
tools/perf/util/metricgroup.c
static int metricgroup__find_metric_callback( const struct pmu_event *pe, const struct pmu_events_table *table __maybe_unused, void *vdata) { struct metricgroup__find_metric_data *data = vdata; if (!match_metric(pe->metric_name, data->metric)) return 0; memcpy(data->pe, pe, sizeof(*pe)); return 1...
[ 1, 0 ]
Linux Kernel
tools/perf/util/metricgroup.c
static int parse_ids(bool metric_no_merge, struct perf_pmu *fake_pmu, struct expr_parse_ctx *ids, const char *modifier, bool has_constraint, const bool tool_events[PERF_TOOL_MAX], struct evlist **out_evlist) { struct parse_events_error parse_error; stru...
[ 1, 0 ]
Linux Kernel
tools/perf/util/metricgroup.c
bool metricgroup__has_metric(const char *metric) { const struct pmu_events_table *table = pmu_events_table__find(); if (!table) return false; return pmu_events_table_for_each_event( table, metricgroup__has_metric_callback, (void *)metric) ? true : false; }
[ 0, 0 ]
Linux Kernel
tools/perf/util/mmap.c
static int perf_mmap__aio_alloc(struct mmap *map, int idx) { map->aio.data[idx] = mmap(NULL, mmap__mmap_len(map), PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, 0, 0); if (map->aio.data[idx] == MAP_FAILED) { map->aio.data[idx] = NULL; return -1; } return 0; }
[ 0, 0 ]
Linux Kernel
tools/perf/util/mmap.c
static int perf_mmap__aio_mmap(struct mmap *map, struct mmap_params *mp) { int delta_max, i, prio, ret; map->aio.nr_cblocks = mp->nr_cblocks; if (map->aio.nr_cblocks) { map->aio.aiocb = calloc(map->aio.nr_cblocks, sizeof(struct aiocb *)); if (!map->aio.aiocb) { pr_debug2("failed to allocate aiocb f...
[ 1, 0 ]
Linux Kernel
tools/perf/util/mmap.c
void mmap__munmap(struct mmap *map) { bitmap_free(map->affinity_mask.bits); #ifndef PYTHON_PERF zstd_fini(&map->zstd_data); #endif perf_mmap__aio_munmap(map); if (map->data != NULL) { munmap(map->data, mmap__mmap_len(map)); map->data = NULL; } auxtrace_mmap__munmap(&map->auxtrace_mmap); }
[ 0, 0 ]
Linux Kernel
tools/perf/util/mutex.c
static void check_err(const char *fn, int err) { char sbuf[STRERR_BUFSIZE]; if (err == 0) return; pr_err("%s error: '%s'\n", fn, str_error_r(err, sbuf, sizeof(sbuf))); }
[ 1, 0 ]
Linux Kernel
tools/perf/util/mutex.c
static void __mutex_init(struct mutex *mtx, bool pshared) { pthread_mutexattr_t attr; CHECK_ERR(pthread_mutexattr_init(&attr)); #ifndef NDEBUG CHECK_ERR(pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK)); #endif if (pshared) CHECK_ERR(pthread_mutexattr_setpshared(&attr, PTHREAD_PROCESS_SHARED));...
[ 0, 0 ]
Linux Kernel
tools/perf/util/mutex.c
void cond_init_pshared(struct cond *cnd) { __cond_init(cnd, true); }
[ 0, 0 ]
Linux Kernel
tools/perf/util/namespaces.c
const char *perf_ns__name(unsigned int id) { if (id >= ARRAY_SIZE(perf_ns__names)) return "UNKNOWN"; return perf_ns__names[id]; }
[ 0, 0 ]
Linux Kernel
tools/perf/util/namespaces.c
void namespaces__free(struct namespaces *namespaces) { free(namespaces); }
[ 1, 0 ]
Linux Kernel
tools/perf/util/namespaces.c
struct nsinfo *nsinfo__new(pid_t pid) { struct nsinfo *nsi; if (pid == 0) return NULL; nsi = calloc(1, sizeof(*nsi)); if (nsi != NULL) { nsi->pid = pid; nsi->tgid = pid; nsi->nstgid = pid; nsi->need_setns = false; nsi->in_pidns = false; if (nsinfo__init(nsi) == -1) nsi->need...
[ 1, 0 ]
Linux Kernel
tools/perf/util/namespaces.c
struct nsinfo *nsinfo__copy(const struct nsinfo *nsi) { struct nsinfo *nnsi; if (nsi == NULL) return NULL; nnsi = calloc(1, sizeof(*nnsi)); if (nnsi != NULL) { nnsi->pid = nsinfo__pid(nsi); nnsi->tgid = nsinfo__tgid(nsi); nnsi->nstgid = nsinfo__nstgid(nsi); nnsi->need_setns = nsinfo__need...
[ 1, 0 ]
Linux Kernel
tools/perf/util/namespaces.c
bool nsinfo__need_setns(const struct nsinfo *nsi) { return nsi->need_setns; }
[ 0, 0 ]
Linux Kernel
tools/perf/util/namespaces.c
pid_t nsinfo__nstgid(const struct nsinfo *nsi) { return nsi->nstgid; }
[ 0, 0 ]
Linux Kernel
tools/perf/util/namespaces.c
bool nsinfo__is_in_root_namespace(void) { struct nsinfo nsi; memset(&nsi, 0x0, sizeof(nsi)); nsinfo__get_nspid(&nsi, "/proc/self/status"); return !nsi.in_pidns; }
[ 1, 0 ]
Linux Kernel
tools/perf/util/off_cpu.h
static inline int off_cpu_prepare(struct evlist *evlist __maybe_unused, struct target *target __maybe_unused, struct record_opts *opts __maybe_unused) { return -1; }
[ 0, 0 ]
Linux Kernel
tools/perf/util/ordered-events.c
static void free_dup_event(struct ordered_events *oe, union perf_event *event) { if (oe->copy_on_queue) __free_dup_event(oe, event); }
[ 0, 0 ]
Linux Kernel
tools/perf/util/ordered-events.c
static int do_flush(struct ordered_events *oe, bool show_progress) { struct list_head *head = &oe->events; struct ordered_event *tmp, *iter; u64 limit = oe->next_flush; u64 last_ts = oe->last ? oe->last->timestamp : 0ULL; struct ui_progress prog; int ret; if (!limit) return 0; if (show_progress) ...
[ 0, 0 ]
Linux Kernel
tools/perf/util/ordered-events.c
u64 ordered_events__first_time(struct ordered_events *oe) { struct ordered_event *event; if (list_empty(&oe->events)) return 0; event = list_first_entry(&oe->events, struct ordered_event, list); return event->timestamp; }
[ 0, 0 ]
Linux Kernel
tools/perf/util/ordered-events.h
static inline void ordered_events__set_copy_on_queue(struct ordered_events *oe, bool copy) { oe->copy_on_queue = copy; }
[ 0, 0 ]
Linux Kernel
tools/perf/util/parse-events-hybrid.c
static void config_hybrid_attr(struct perf_event_attr *attr, int type, int pmu_type) { attr->type = type; attr->config = (attr->config & PERF_HW_EVENT_MASK) | ((__u64)pmu_type << PERF_PMU_TYPE_SHIFT); }
[ 1, 0 ]
Linux Kernel
tools/perf/util/parse-events-hybrid.c
static int create_event_hybrid(__u32 config_type, int *idx, struct list_head *list, struct perf_event_attr *attr, const char *name, const char *metric_id, struct list_head *config_terms, ...
[ 1, 0 ]
Linux Kernel
tools/perf/util/parse-events-hybrid.c
static int create_raw_event_hybrid(int *idx, struct list_head *list, struct perf_event_attr *attr, const char *name, const char *metric_id, struct list_head *config_terms, struct ...
[ 0, 0 ]
Linux Kernel
tools/perf/util/parse-events-hybrid.c
int parse_events__add_cache_hybrid(struct list_head *list, int *idx, struct perf_event_attr *attr, const char *name, const char *metric_id, struct list_head *config_terms, bool *hybrid, ...
[ 0, 0 ]
Linux Kernel
tools/perf/util/parse-events.c
static char *get_config_metric_id(struct list_head *head_terms) { return get_config_str(head_terms, PARSE_EVENTS__TERM_TYPE_METRIC_ID); }
[ 0, 0 ]
Linux Kernel
tools/perf/util/parse-events.c
static int add_event_tool(struct list_head *list, int *idx, enum perf_tool_event tool_event) { struct evsel *evsel; struct perf_event_attr attr = { .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_SW_DUMMY, }; evsel = __add_event(list, idx, &attr, true, /*name=*/NULL, ...
[ 1, 0 ]
Linux Kernel
tools/perf/util/parse-events.c
static int parse_aliases(char *str, const char *const names[][EVSEL__MAX_ALIASES], int size) { int i, j; int n, longest = -1; for (i = 0; i < size; i++) { for (j = 0; j < EVSEL__MAX_ALIASES && names[i][j]; j++) { n = strlen(names[i][j]); if (n > ...
[ 1, 0 ]
Linux Kernel
tools/perf/util/parse-events.c
int parse_events_load_bpf_obj(struct parse_events_state *parse_state, struct list_head *list, struct bpf_object *obj, struct list_head *head_config) { int err; char errbuf[BUFSIZ]; struct __add_bpf_event_param param = {parse_state, list, head_config}; ...
[ 1, 0 ]
Linux Kernel
tools/perf/util/parse-events.c
static int parse_events_config_bpf(struct parse_events_state *parse_state, struct bpf_object *obj, struct list_head *head_config) { struct parse_events_term *term; int error_pos; if (!head_config || list_empty(head_config)) return 0; l...
[ 1, 0 ]
Linux Kernel
tools/perf/util/parse-events.c
int parse_events_load_bpf(struct parse_events_state *parse_state, struct list_head *list, char *bpf_file_name, bool source, struct list_head *head_config) { int err; struct bpf_object *obj; LIST_HEAD(obj_head_config); if (head_config) split_bpf_config_ter...
[ 1, 0 ]
Linux Kernel
tools/perf/util/parse-events.c
int parse_events_add_breakpoint(struct list_head *list, int *idx, u64 addr, char *type, u64 len) { struct perf_event_attr attr; memset(&attr, 0, sizeof(attr)); attr.bp_addr = addr; if (parse_breakpoint_type(type, &attr)) return -EINVAL; if (!len) { if (attr.bp_type =...
[ 1, 0 ]
Linux Kernel
tools/perf/util/parse-events.c
void parse_events__shrink_config_terms(void) { config_term_shrinked = true; }
[ 0, 0 ]
Linux Kernel
tools/perf/util/parse-events.c
int parse_events_add_tracepoint(struct list_head *list, int *idx, const char *sys, const char *event, struct parse_events_error *err, struct list_head *head_config) { if (head_config) { struct perf_event_attr attr; ...
[ 0, 0 ]
Linux Kernel
tools/perf/util/parse-events.c
int parse_events_add_tool(struct parse_events_state *parse_state, struct list_head *list, int tool_event) { return add_event_tool(list, &parse_state->idx, tool_event); }
[ 0, 0 ]
Linux Kernel
tools/perf/util/parse-events.c
void parse_events__set_leader(char *name, struct list_head *list, struct parse_events_state *parse_state) { struct evsel *leader; if (list_empty(list)) { WARN_ONCE(true, "WARNING: failed to set leader: empty list"); return; } if (parse_events__set_leader_for_uncore_alias...
[ 0, 0 ]
Linux Kernel
tools/perf/util/parse-events.c
void parse_events_update_lists(struct list_head *list_event, struct list_head *list_all) { list_splice_tail(list_event, list_all); free(list_event); }
[ 1, 0 ]
Linux Kernel
tools/perf/util/parse-events.c
static int comp_pmu(const void *p1, const void *p2) { struct perf_pmu_event_symbol *pmu1 = (struct perf_pmu_event_symbol *)p1; struct perf_pmu_event_symbol *pmu2 = (struct perf_pmu_event_symbol *)p2; return strcasecmp(pmu1->symbol, pmu2->symbol); }
[ 0, 0 ]
Linux Kernel
tools/perf/util/parse-events.c
void parse_events_error__init(struct parse_events_error *err) { bzero(err, sizeof(*err)); }
[ 1, 0 ]
Linux Kernel
tools/perf/util/parse-events.c
void parse_events_error__exit(struct parse_events_error *err) { zfree(&err->str); zfree(&err->help); zfree(&err->first_str); zfree(&err->first_help); }
[ 0, 0 ]
Linux Kernel
tools/perf/util/parse-events.c
int exclude_perf(const struct option *opt, const char *arg __maybe_unused, int unset __maybe_unused) { struct evlist *evlist = *(struct evlist **)opt->value; return foreach_evsel_in_last_glob(evlist, add_exclude_perf_filter, NULL); }
[ 0, 0 ]
Linux Kernel
tools/perf/util/parse-events.c
int parse_events__is_hardcoded_term(struct parse_events_term *term) { return term->type_term != PARSE_EVENTS__TERM_TYPE_USER; }
[ 0, 0 ]
Linux Kernel
tools/perf/util/parse-events.c
int parse_events_term__clone(struct parse_events_term **new, struct parse_events_term *term) { char *str; struct parse_events_term temp = { .type_val = term->type_val, .type_term = term->type_term, .config = NULL, .err_term = term->err_term, .err_val = ter...
[ 0, 0 ]
Linux Kernel
tools/perf/util/parse-events.c
int parse_events_copy_term_list(struct list_head *old, struct list_head **new) { struct parse_events_term *term, *n; int ret; if (!old) { *new = NULL; return 0; } *new = malloc(sizeof(struct list_head)); if (!*new) return -ENOMEM; INIT_LIST_HEAD(*new); list_for_each_entry(term, old, list...
[ 1, 0 ]
Linux Kernel
tools/perf/util/parse-events.c
static void config_terms_list(char *buf, size_t buf_sz) { int i; bool first = true; buf[0] = '\0'; for (i = 0; i < __PARSE_EVENTS__TERM_TYPE_NR; i++) { const char *name = config_term_names[i]; if (!config_term_avail(i, NULL)) continue; if (!name) continue; if (name[0] == '<') ...
[ 1, 0 ]
Linux Kernel
tools/perf/util/parse-events.c
char *parse_events_formats_error_string(char *additional_terms) { char *str; char static_terms[__PARSE_EVENTS__TERM_TYPE_NR * (sizeof("no-overwrite") - 1)]; config_terms_list(static_terms, sizeof(static_terms)); /* valid terms */ if (additional_terms) { if (asprintf(&str, "valid terms: %s,%s", add...
[ 1, 0 ]
Linux Kernel
tools/perf/util/parse-regs-options.c
static int __parse_regs(const struct option *opt, const char *str, int unset, bool intr) { uint64_t *mode = (uint64_t *)opt->value; const struct sample_reg *r = NULL; char *s, *os = NULL, *p; int ret = -1; uint64_t mask; if (unset) return 0; if (*mode) return -1; if (i...
[ 1, 0 ]
Linux Kernel
tools/perf/util/parse-sublevel-options.c
int perf_parse_sublevel_options(const char *str, struct sublevel_option *opts) { char *s = strdup(str); char *p = NULL; int ret; if (!s) { pr_err("no memory\n"); return -1; } p = strtok(s, ","); while (p) { ret = parse_one_sublevel_option(p, opts); if (ret) { free(s); return ...
[ 1, 0 ]
Linux Kernel
tools/perf/util/path.c
int path__join3(char *bf, size_t size, const char *path1, const char *path2, const char *path3) { return scnprintf(bf, size, "%s%s%s%s%s", path1, path1[0] ? "/" : "", path2, path2[0] ? "/" : "", path3); }
[ 0, 0 ]
Linux Kernel
tools/perf/util/path.c
bool is_executable_file(const char *base_path, const struct dirent *dent) { char path[PATH_MAX]; struct stat st; snprintf(path, sizeof(path), "%s/%s", base_path, dent->d_name); if (stat(path, &st)) return false; return !S_ISDIR(st.st_mode) && (st.st_mode & S_IXUSR); }
[ 1, 0 ]
Linux Kernel
tools/perf/util/perf-hooks.c
void perf_hooks__invoke(const struct perf_hook_desc *desc) { if (!(desc && desc->p_hook_func && *desc->p_hook_func)) return; if (sigsetjmp(jmpbuf, 1)) { pr_warning("Fatal error (SEGFAULT) in perf hook '%s'\n", desc->hook_name); *(current_perf_hook->p_hook_func) = NULL; } else { current_perf_hook...
[ 1, 0 ]
Linux Kernel
tools/perf/util/perf_api_probe.c
static void perf_probe_comm_exec(struct evsel *evsel) { evsel->core.attr.comm_exec = 1; }
[ 0, 0 ]
Linux Kernel
tools/perf/util/perf_api_probe.c
bool perf_can_aux_sample(void) { struct perf_event_attr attr = { .size = sizeof(struct perf_event_attr), .exclude_kernel = 1, .aux_sample_size = 1, }; int fd; fd = sys_perf_event_open(&attr, -1, 0, -1, 0); /* * If the kernel attribute is big enough to contain aux_sample_size * then w...
[ 1, 0 ]
Linux Kernel
tools/perf/util/perf_api_probe.c
bool perf_can_record_cgroup(void) { return perf_probe_api(perf_probe_cgroup); }
[ 0, 0 ]
Linux Kernel
tools/perf/util/perf_regs.c
static const char *__perf_reg_name_arm(int id) { switch (id) { case PERF_REG_ARM_R0: return "r0"; case PERF_REG_ARM_R1: return "r1"; case PERF_REG_ARM_R2: return "r2"; case PERF_REG_ARM_R3: return "r3"; case PERF_REG_ARM_R4: return "r4"; case PERF_REG_ARM_R5: return "r5"; case P...
[ 0, 0 ]
Linux Kernel
tools/perf/util/perf_regs.c
int perf_reg_value(u64 *valp, struct regs_dump *regs, int id) { int i, idx = 0; u64 mask = regs->mask; if ((u64)id >= PERF_SAMPLE_REGS_CACHE_SIZE) return -EINVAL; if (regs->cache_mask & (1ULL << id)) goto out; if (!(mask & (1ULL << id))) return -EINVAL; for (i = 0; i < id; i++) { if (ma...
[ 0, 0 ]
Linux Kernel
tools/perf/util/pfm.h
static inline int parse_libpfm_events_option(const struct option *opt __maybe_unused, const char *str __maybe_unused, int unset __maybe_unused) { return 0; }
[ 0, 0 ]
Linux Kernel
tools/perf/util/pmu-hybrid.c
bool perf_pmu__is_hybrid(const char *name) { return perf_pmu__find_hybrid_pmu(name) != NULL; }
[ 0, 0 ]
Linux Kernel
tools/perf/util/pmu.c
int perf_pmu__format_parse(char *dir, struct list_head *head) { struct dirent *evt_ent; DIR *format_dir; int ret = 0; format_dir = opendir(dir); if (!format_dir) return -EINVAL; while (!ret && (evt_ent = readdir(format_dir))) { char path[PATH_MAX]; char *name = evt_ent->d_name; FILE *file;...
[ 1, 0 ]
Linux Kernel
tools/perf/util/pmu.c
static int perf_pmu__parse_scale(struct perf_pmu_alias *alias, char *dir, char *name) { struct stat st; ssize_t sret; char scale[128]; int fd, ret = -1; char path[PATH_MAX]; scnprintf(path, PATH_MAX, "%s/%s.scale", dir, name); fd = open(path, O_RDONLY); if (fd == -1) ...
[ 1, 0 ]