Projectname
large_stringclasses
15 values
Filepath
large_stringlengths
4
106
⌀
Function
large_stringlengths
11
3.45k
Label
list
Linux Kernel
tools/perf/util/evlist.h
static inline bool evlist__empty(struct evlist *evlist) { return list_empty(&evlist->core.entries); }
[ 0, 0 ]
Linux Kernel
tools/perf/util/evsel.c
const char *perf_tool_event__to_str(enum perf_tool_event ev) { if (ev > PERF_TOOL_NONE && ev < PERF_TOOL_MAX) return perf_tool_event__tool_names[ev]; return NULL; }
[ 1, 0 ]
Linux Kernel
tools/perf/util/evsel.c
enum perf_tool_event perf_tool_event__from_str(const char *str) { int i; perf_tool_event__for_each_event(i) { if (!strcmp(str, perf_tool_event__tool_names[i])) return i; } return PERF_TOOL_NONE; }
[ 0, 0 ]
Linux Kernel
tools/perf/util/evsel.c
static int evsel__no_extra_init(struct evsel *evsel __maybe_unused) { return 0; }
[ 0, 0 ]
Linux Kernel
tools/perf/util/evsel.c
int __evsel__sample_size(u64 sample_type) { u64 mask = sample_type & PERF_SAMPLE_MASK; int size = 0; int i; for (i = 0; i < 64; i++) { if (mask & (1ULL << i)) size++; } size *= sizeof(u64); return size; }
[ 1, 0 ]
Linux Kernel
tools/perf/util/evsel.c
static int __perf_evsel__calc_id_pos(u64 sample_type) { int idx = 0; if (sample_type & PERF_SAMPLE_IDENTIFIER) return 0; if (!(sample_type & PERF_SAMPLE_ID)) return -1; if (sample_type & PERF_SAMPLE_IP) idx += 1; if (sample_type & PERF_SAMPLE_TID) idx += 1; if (sample_type & PERF_SAMPLE...
[ 0, 0 ]
Linux Kernel
tools/perf/util/evsel.c
void evsel__set_sample_id(struct evsel *evsel, bool can_sample_identifier) { if (can_sample_identifier) { evsel__reset_sample_bit(evsel, ID); evsel__set_sample_bit(evsel, IDENTIFIER); } else { evsel__set_sample_bit(evsel, ID); } evsel->core.attr.read_format |= PERF_FORMAT_ID; }
[ 0, 0 ]
Linux Kernel
tools/perf/util/evsel.c
bool evsel__is_function_event(struct evsel *evsel) { #define FUNCTION_EVENT "ftrace:function" return evsel->name && !strncmp(FUNCTION_EVENT, evsel->name, sizeof(FUNCTION_EVENT)); #undef FUNCTION_EVENT }
[ 1, 0 ]
Linux Kernel
tools/perf/util/evsel.c
struct evsel *evsel__new_idx(struct perf_event_attr *attr, int idx) { struct evsel *evsel = zalloc(perf_evsel__object.size); if (!evsel) return NULL; evsel__init(evsel, attr, idx); if (evsel__is_bpf_output(evsel) && !attr->sample_type) { evsel->core.attr.sample_type = (PERF_SAMPLE_RAW | PERF_SAMPLE_T...
[ 1, 0 ]
Linux Kernel
tools/perf/util/evsel.c
struct evsel *evsel__new_cycles(bool precise __maybe_unused, __u32 type, __u64 config) { struct perf_event_attr attr = { .type = type, .config = config, .exclude_kernel = !perf_event_can_profile_kernel(), }; struct evsel *evsel; event_attr_init(&attr); evsel...
[ 0, 0 ]
Linux Kernel
tools/perf/util/evsel.c
static int evsel__add_modifiers(struct evsel *evsel, char *bf, size_t size) { int colon = 0, r = 0; struct perf_event_attr *attr = &evsel->core.attr; bool exclude_guest_default = false; #define MOD_PRINT(context, mod) \ do { ...
[ 1, 0 ]
Linux Kernel
tools/perf/util/evsel.c
static int evsel__tool_name(enum perf_tool_event ev, char *bf, size_t size) { return scnprintf(bf, size, "%s", perf_tool_event__to_str(ev)); }
[ 0, 0 ]
Linux Kernel
tools/perf/util/evsel.c
static int __evsel__bp_name(char *bf, size_t size, u64 addr, u64 type) { int r; r = scnprintf(bf, size, "mem:0x%" PRIx64 ":", addr); if (type & HW_BREAKPOINT_R) r += scnprintf(bf + r, size - r, "r"); if (type & HW_BREAKPOINT_W) r += scnprintf(bf + r, size - r, "w"); if (type & HW_BREAKPOINT_X) ...
[ 0, 0 ]
Linux Kernel
tools/perf/util/evsel.c
static int evsel__raw_name(struct evsel *evsel, char *bf, size_t size) { int ret = scnprintf(bf, size, "raw 0x%" PRIx64, evsel->core.attr.config); return ret + evsel__add_modifiers(evsel, bf + ret, size - ret); }
[ 0, 0 ]
Linux Kernel
tools/perf/util/evsel.c
const char *evsel__name(struct evsel *evsel) { char bf[128]; if (!evsel) goto out_unknown; if (evsel->name) return evsel->name; switch (evsel->core.attr.type) { case PERF_TYPE_RAW: evsel__raw_name(evsel, bf, sizeof(bf)); break; case PERF_TYPE_HARDWARE: evsel__hw_name(evsel, bf, size...
[ 1, 0 ]
Linux Kernel
tools/perf/util/evsel.c
const char *evsel__group_name(struct evsel *evsel) { return evsel->group_name ?: "anon group"; }
[ 0, 0 ]
Linux Kernel
tools/perf/util/evsel.c
static void evsel__reset_callgraph(struct evsel *evsel, struct callchain_param *param) { struct perf_event_attr *attr = &evsel->core.attr; evsel__reset_sample_bit(evsel, CALLCHAIN); if (param->record_mode == CALLCHAIN_LBR) { evsel__reset_sample_bit(evsel, BRANCH_STACK); ...
[ 0, 0 ]
Linux Kernel
tools/perf/util/evsel.c
void __weak arch_evsel__set_sample_weight(struct evsel *evsel) { evsel__set_sample_bit(evsel, WEIGHT); }
[ 0, 0 ]
Linux Kernel
tools/perf/util/evsel.c
void evsel__delete(struct evsel *evsel) { evsel__exit(evsel); free(evsel); }
[ 1, 0 ]
Linux Kernel
tools/perf/util/evsel.c
static int evsel__read_one(struct evsel *evsel, int cpu_map_idx, int thread) { struct perf_counts_values *count = perf_counts(evsel->counts, cpu_map_idx, thread); return perf_evsel__read(&evsel->core, cpu_map_idx, thread, count); }
[ 0, 0 ]
Linux Kernel
tools/perf/util/evsel.c
int __evsel__read_on_cpu(struct evsel *evsel, int cpu_map_idx, int thread, bool scale) { struct perf_counts_values count; size_t nv = scale ? 3 : 1; if (FD(evsel, cpu_map_idx, thread) < 0) return -EINVAL; if (evsel->counts == NULL && evsel__alloc_counts(evsel) < 0) return -EN...
[ 1, 0 ]
Linux Kernel
tools/perf/util/evsel.c
static int get_group_fd(struct evsel *evsel, int cpu_map_idx, int thread) { struct evsel *leader = evsel__leader(evsel); int fd; if (evsel__is_group_leader(evsel)) return -1; BUG_ON(!leader->core.fd); cpu_map_idx = evsel__hybrid_group_cpu_map_idx(evsel, cpu_map_idx); if (cpu_map_idx == -1) return...
[ 0, 0 ]
Linux Kernel
tools/perf/util/evsel.c
static bool evsel__ignore_missing_thread(struct evsel *evsel, int nr_cpus, int cpu_map_idx, struct perf_thread_map *threads, int thread, int err) { pid_t ignore_pid = perf_thread_map__pid(threads...
[ 1, 0 ]
Linux Kernel
tools/perf/util/evsel.c
static void display_attr(struct perf_event_attr *attr) { if (verbose >= 2 || debug_peo_args) { fprintf(stderr, "%.60s\n", graph_dotted_line); fprintf(stderr, "perf_event_attr:\n"); perf_event_attr__fprintf(stderr, attr, __open_attr__fprintf, NULL); fprintf(stderr, "%.60s\n", graph_dotted_line); } }
[ 0, 0 ]
Linux Kernel
tools/perf/util/evsel.c
int evsel__prepare_open(struct evsel *evsel, struct perf_cpu_map *cpus, struct perf_thread_map *threads) { int err; err = __evsel__prepare_open(evsel, cpus, threads); if (err) return err; evsel__disable_missing_features(evsel); return err; }
[ 0, 0 ]
Linux Kernel
tools/perf/util/evsel.c
int evsel__open(struct evsel *evsel, struct perf_cpu_map *cpus, struct perf_thread_map *threads) { return evsel__open_cpu(evsel, cpus, threads, 0, perf_cpu_map__nr(cpus)); }
[ 0, 0 ]
Linux Kernel
tools/perf/util/evsel.c
void evsel__close(struct evsel *evsel) { perf_evsel__close(&evsel->core); perf_evsel__free_id(&evsel->core); }
[ 0, 0 ]
Linux Kernel
tools/perf/util/evsel.c
int evsel__open_per_thread(struct evsel *evsel, struct perf_thread_map *threads) { return evsel__open(evsel, NULL, threads); }
[ 0, 0 ]
Linux Kernel
tools/perf/util/evsel.c
static int perf_evsel__parse_id_sample(const struct evsel *evsel, const union perf_event *event, struct perf_sample *sample) { u64 type = evsel->core.attr.sample_type; const __u64 *array = event->sample.array; bool swapped = evsel->need...
[ 1, 0 ]
Linux Kernel
tools/perf/util/evsel.c
static inline bool overflow(const void *endp, u16 max_size, const void *offset, u64 size) { return size > max_size || offset + size > endp; } #define OVERFLOW_CHECK(offset, size, max_size) \ do { ...
[ 1, 0 ]
Linux Kernel
tools/perf/util/evsel.c
bool evsel__fallback(struct evsel *evsel, int err, char *msg, size_t msgsize) { int paranoid; if ((err == ENOENT || err == ENXIO || err == ENODEV) && evsel->core.attr.type == PERF_TYPE_HARDWARE && evsel->core.attr.config == PERF_COUNT_HW_CPU_CYCLES) { scnprintf(msg, msgsize, "%s", "T...
[ 1, 0 ]
Linux Kernel
tools/perf/util/evsel.h
static inline int evsel__read_on_cpu(struct evsel *evsel, int cpu_map_idx, int thread) { return __evsel__read_on_cpu(evsel, cpu_map_idx, thread, false); }
[ 0, 0 ]
Linux Kernel
tools/perf/util/evsel.h
static inline struct evsel *evsel__prev(struct evsel *evsel) { return list_entry(evsel->core.node.prev, struct evsel, core.node); }
[ 0, 0 ]
Linux Kernel
tools/perf/util/evsel.h
static inline bool evsel__has_branch_callstack(const struct evsel *evsel) { return evsel->core.attr.branch_sample_type & PERF_SAMPLE_BRANCH_CALL_STACK; }
[ 0, 0 ]
Linux Kernel
tools/perf/util/evsel.h
static inline bool evsel__has_branch_hw_idx(const struct evsel *evsel) { return evsel->core.attr.branch_sample_type & PERF_SAMPLE_BRANCH_HW_INDEX; }
[ 0, 0 ]
Linux Kernel
tools/perf/util/evsel.h
static inline bool evsel__has_br_stack(const struct evsel *evsel) { return evsel->core.attr.sample_type & PERF_SAMPLE_BRANCH_STACK || evsel->synth_sample_type & PERF_SAMPLE_BRANCH_STACK; }
[ 0, 0 ]
Linux Kernel
tools/perf/util/evsel_fprintf.c
int evsel__fprintf(struct evsel *evsel, struct perf_attr_details *details, FILE *fp) { bool first = true; int printed = 0; if (details->event_group) { struct evsel *pos; if (!evsel__is_group_leader(evsel)) return 0; if (evsel->core.nr_members > 1) printed += fprintf(...
[ 0, 0 ]
Linux Kernel
tools/perf/util/evsel_fprintf.c
int sample__fprintf_sym(struct perf_sample *sample, struct addr_location *al, int left_alignment, unsigned int print_opts, struct callchain_cursor *cursor, struct strlist *bt_stop_list, FILE *fp) { int printed = 0; int print_ip = print_opts & ...
[ 0, 0 ]
Linux Kernel
tools/perf/util/evswitch.c
int evswitch__init(struct evswitch *evswitch, struct evlist *evlist, FILE *fp) { if (evswitch->on_name) { evswitch->on = evlist__find_evsel_by_str(evlist, evswitch->on_name); if (evswitch->on == NULL) { evswitch__fprintf_enoent(fp, "on", evswitch->on_name); return -ENOENT; } evswitch->dis...
[ 0, 0 ]
Linux Kernel
tools/perf/util/expr.c
static size_t key_hash(long key, void *ctx __maybe_unused) { const char *str = (const char *)key; size_t hash = 0; while (*str != '\0') { hash *= 31; hash += *str; str++; } return hash; }
[ 0, 0 ]
Linux Kernel
tools/perf/util/expr.c
int ids__insert(struct hashmap *ids, const char *id) { struct expr_id_data *data_ptr = NULL, *old_data = NULL; char *old_key = NULL; int ret; ret = hashmap__set(ids, id, data_ptr, &old_key, &old_data); if (ret) free(data_ptr); free(old_key); free(old_data); return ret; }
[ 1, 0 ]
Linux Kernel
tools/perf/util/expr.c
bool expr__subset_of_ids(struct expr_parse_ctx *haystack, struct expr_parse_ctx *needles) { struct hashmap_entry *cur; size_t bkt; struct expr_id_data *data; hashmap__for_each_entry(needles->ids, cur, bkt) { if (expr__get_id(haystack, cur->pkey, &data)) return false; } r...
[ 0, 0 ]
Linux Kernel
tools/perf/util/expr.c
void expr__ctx_clear(struct expr_parse_ctx *ctx) { struct hashmap_entry *cur; size_t bkt; hashmap__for_each_entry(ctx->ids, cur, bkt) { free((void *)cur->pkey); free(cur->pvalue); } hashmap__clear(ctx->ids); }
[ 1, 0 ]
Linux Kernel
tools/perf/util/expr.c
int expr__parse(double *final_val, struct expr_parse_ctx *ctx, const char *expr) { return __expr__parse(final_val, ctx, expr, false) ? -1 : 0; }
[ 0, 0 ]
Linux Kernel
tools/perf/util/fncache.c
unsigned shash(const unsigned char *s) { unsigned h = 0; while (*s) h = 65599 * h + *s++; return h ^ (h >> 16); }
[ 1, 0 ]
Linux Kernel
tools/perf/util/genelf_debug.c
static inline int buffer_ext_add(struct buffer_ext *be, void *addr, size_t sz) { void *tmp; size_t be_sz = be->max_sz; retry: if ((be->cur_pos + sz) < be_sz) { memcpy(be->data + be->cur_pos, addr, sz); be->cur_pos += sz; return 0; } if (!be_sz) be_sz = BUFFER_EXT_DFL_SIZE; else be_sz ...
[ 1, 0 ]
Linux Kernel
tools/perf/util/genelf_debug.c
static inline size_t buffer_ext_size(struct buffer_ext *be) { return be->cur_pos; }
[ 0, 0 ]
Linux Kernel
tools/perf/util/genelf_debug.c
static inline void *buffer_ext_addr(struct buffer_ext *be) { return be->data; }
[ 0, 0 ]
Linux Kernel
tools/perf/util/genelf_debug.c
static void emit_unsigned_LEB128(struct buffer_ext *be, unsigned long data) { do { ubyte cur = data & 0x7F; data >>= 7; if (data) cur |= 0x80; buffer_ext_add(be, &cur, 1); } while (data); }
[ 1, 0 ]
Linux Kernel
tools/perf/util/genelf_debug.c
static void emit_signed_LEB128(struct buffer_ext *be, long data) { int more = 1; int negative = data < 0; int size = sizeof(long) * CHAR_BIT; while (more) { ubyte cur = data & 0x7F; data >>= 7; if (negative) data |= -(1 << (size - 7)); if ((data == 0 && !(cur & 0x40)) || (data == -1l && (...
[ 1, 0 ]
Linux Kernel
tools/perf/util/genelf_debug.c
static void emit_opcode_unsigned(struct buffer_ext *be, ubyte opcode, unsigned long data) { buffer_ext_add(be, &opcode, 1); emit_unsigned_LEB128(be, data); }
[ 0, 0 ]
Linux Kernel
tools/perf/util/genelf_debug.c
static void emit_lne_set_address(struct buffer_ext *be, void *address) { emit_extended_opcode(be, DW_LNE_set_address, &address, sizeof(unsigned long)); }
[ 1, 0 ]
Linux Kernel
tools/perf/util/genelf_debug.c
static void emit_lineno_info(struct buffer_ext *be, struct debug_entry *ent, size_t nr_entry, unsigned long code_addr) { size_t i; /* start state of the state machine we take care of */ unsigned long last_vma = 0; char const *cur_filename = NULL; unsigned long cur_file_idx = 0; ...
[ 1, 0 ]
Linux Kernel
tools/perf/util/genelf_debug.c
static void add_debug_line(struct buffer_ext *be, struct debug_entry *ent, size_t nr_entry, unsigned long code_addr) { struct debug_line_header *dbg_header; size_t old_size; old_size = buffer_ext_size(be); buffer_ext_add(be, (void *)&default_debug_line_header, sizeo...
[ 1, 0 ]
Linux Kernel
tools/perf/util/genelf_debug.c
static void add_debug_abbrev(struct buffer_ext *be) { emit_unsigned_LEB128(be, 1); emit_unsigned_LEB128(be, DW_TAG_compile_unit); emit_unsigned_LEB128(be, DW_CHILDREN_yes); emit_unsigned_LEB128(be, DW_AT_stmt_list); emit_unsigned_LEB128(be, DW_FORM_data4); emit_unsigned_LEB128(be, 0); emit_unsigned_LEB12...
[ 0, 0 ]
Linux Kernel
tools/perf/util/hashmap.c
static void hashmap_add_entry(struct hashmap_entry **pprev, struct hashmap_entry *entry) { entry->next = *pprev; *pprev = entry; }
[ 0, 0 ]
Linux Kernel
tools/perf/util/hashmap.c
void hashmap__free(struct hashmap *map) { if (IS_ERR_OR_NULL(map)) return; hashmap__clear(map); free(map); }
[ 1, 0 ]
Linux Kernel
tools/perf/util/header.c
bool perf_header__has_feat(const struct perf_header *header, int feat) { return test_bit(feat, header->adds_features); }
[ 0, 0 ]
Linux Kernel
tools/perf/util/header.c
static int do_write_string(struct feat_fd *ff, const char *str) { u32 len, olen; int ret; olen = strlen(str) + 1; len = PERF_ALIGN(olen, NAME_ALIGN); ret = do_write(ff, &len, sizeof(len)); if (ret < 0) return ret; return write_padded(ff, str, olen, len); }
[ 1, 0 ]
Linux Kernel
tools/perf/util/header.c
static int __do_read(struct feat_fd *ff, void *addr, ssize_t size) { if (!ff->buf) return __do_read_fd(ff, addr, size); return __do_read_buf(ff, addr, size); }
[ 0, 0 ]
Linux Kernel
tools/perf/util/header.c
static int do_read_u64(struct feat_fd *ff, u64 *addr) { int ret; ret = __do_read(ff, addr, sizeof(*addr)); if (ret) return ret; if (ff->ph->needs_swap) *addr = bswap_64(*addr); return 0; }
[ 1, 0 ]
Linux Kernel
tools/perf/util/header.c
static char *do_read_string(struct feat_fd *ff) { u32 len; char *buf; if (do_read_u32(ff, &len)) return NULL; buf = malloc(len); if (!buf) return NULL; if (!__do_read(ff, buf, len)) { return buf; } free(buf); return NULL; }
[ 1, 0 ]
Linux Kernel
tools/perf/util/header.c
static int write_osrelease(struct feat_fd *ff, struct evlist *evlist __maybe_unused) { struct utsname uts; int ret; ret = uname(&uts); if (ret < 0) return -1; return do_write_string(ff, uts.release); }
[ 0, 0 ]
Linux Kernel
tools/perf/util/header.c
static int write_nrcpus(struct feat_fd *ff, struct evlist *evlist __maybe_unused) { long nr; u32 nrc, nra; int ret; nrc = cpu__max_present_cpu().cpu; nr = sysconf(_SC_NPROCESSORS_ONLN); if (nr < 0) return -1; nra = (u32)(nr & UINT_MAX); ret = do_write(ff, &nrc, sizeof(n...
[ 1, 0 ]
Linux Kernel
tools/perf/util/header.c
static int write_numa_topology(struct feat_fd *ff, struct evlist *evlist __maybe_unused) { struct numa_topology *tp; int ret = -1; u32 i; tp = numa_topology__new(); if (!tp) return -ENOMEM; ret = do_write(ff, &tp->nr, sizeof(u32)); if (ret < 0) goto err; for (i...
[ 1, 0 ]
Linux Kernel
tools/perf/util/header.c
char *__weak get_cpuid_str(struct perf_pmu *pmu __maybe_unused) { return NULL; }
[ 0, 0 ]
Linux Kernel
tools/perf/util/header.c
static int write_clock_data(struct feat_fd *ff, struct evlist *evlist __maybe_unused) { u64 *data64; u32 data32; int ret; data32 = 1; ret = do_write(ff, &data32, sizeof(data32)); if (ret < 0) return ret; /* clockid */ data32 = ff->ph->env.clock.clockid; ret = do_wri...
[ 1, 0 ]
Linux Kernel
tools/perf/util/header.c
int is_cpu_online(unsigned int cpu) { char *str; size_t strlen; char buf[256]; int status = -1; struct stat statbuf; snprintf(buf, sizeof(buf), "/sys/devices/system/cpu/cpu%d", cpu); if (stat(buf, &statbuf) != 0) return 0; snprintf(buf, sizeof(buf), "/sys/devices/system/cpu/cpu%d/online", cpu); ...
[ 1, 0 ]
Linux Kernel
tools/perf/util/header.c
static int build_caches(struct cpu_cache_level caches[], u32 *cntp) { u32 i, cnt = 0; u32 nr, cpu; u16 level; nr = cpu__max_cpu().cpu; for (cpu = 0; cpu < nr; cpu++) { for (level = 0; level < MAX_CACHE_LVL; level++) { struct cpu_cache_level c; int err; err = cpu_cache_level__read(&c,...
[ 0, 0 ]
Linux Kernel
tools/perf/util/header.c
static void print_hostname(struct feat_fd *ff, FILE *fp) { fprintf(fp, "# hostname : %s\n", ff->ph->env.hostname); }
[ 1, 0 ]
Linux Kernel
tools/perf/util/header.c
static void print_cpudesc(struct feat_fd *ff, FILE *fp) { fprintf(fp, "# cpudesc : %s\n", ff->ph->env.cpu_desc); }
[ 1, 0 ]
Linux Kernel
tools/perf/util/header.c
static void print_nrcpus(struct feat_fd *ff, FILE *fp) { fprintf(fp, "# nrcpus online : %u\n", ff->ph->env.nr_cpus_online); fprintf(fp, "# nrcpus avail : %u\n", ff->ph->env.nr_cpus_avail); }
[ 1, 0 ]
Linux Kernel
tools/perf/util/header.c
static void print_cmdline(struct feat_fd *ff, FILE *fp) { int nr, i; nr = ff->ph->env.nr_cmdline; fprintf(fp, "# cmdline : "); for (i = 0; i < nr; i++) { char *argv_i = strdup(ff->ph->env.cmdline_argv[i]); if (!argv_i) { fprintf(fp, "%s ", ff->ph->env.cmdline_argv[i]); } else { char ...
[ 1, 0 ]
Linux Kernel
tools/perf/util/header.c
static void print_clockid(struct feat_fd *ff, FILE *fp) { fprintf(fp, "# clockid frequency: %" PRIu64 " MHz\n", ff->ph->env.clock.clockid_res_ns * 1000); }
[ 1, 0 ]
Linux Kernel
tools/perf/util/header.c
static void print_dir_format(struct feat_fd *ff, FILE *fp) { struct perf_session *session; struct perf_data *data; session = container_of(ff->ph, struct perf_session, header); data = session->data; fprintf(fp, "# directory data version : %" PRIu64 "\n", data->dir.version); }
[ 0, 0 ]
Linux Kernel
tools/perf/util/header.c
static void print_bpf_prog_info(struct feat_fd *ff, FILE *fp) { struct perf_env *env = &ff->ph->env; struct rb_root *root; struct rb_node *next; down_read(&env->bpf_progs.lock); root = &env->bpf_progs.infos; next = rb_first(root); while (next) { struct bpf_prog_info_node *node; node = rb_entry...
[ 0, 0 ]
Linux Kernel
tools/perf/util/header.c
static void print_bpf_btf(struct feat_fd *ff, FILE *fp) { struct perf_env *env = &ff->ph->env; struct rb_root *root; struct rb_node *next; down_read(&env->bpf_progs.lock); root = &env->bpf_progs.btfs; next = rb_first(root); while (next) { struct btf_node *node; node = rb_entry(next, struct bt...
[ 0, 0 ]
Linux Kernel
tools/perf/util/header.c
static void free_event_desc(struct evsel *events) { struct evsel *evsel; if (!events) return; for (evsel = events; evsel->core.attr.size; evsel++) { zfree(&evsel->name); zfree(&evsel->core.id); } free(events); }
[ 1, 0 ]
Linux Kernel
tools/perf/util/header.c
static bool perf_attr_check(struct perf_event_attr *attr) { if (attr->__reserved_1 || attr->__reserved_2 || attr->__reserved_3) { pr_warning("Reserved bits are set unexpectedly. " "Please update perf tool.\n"); return false; } if (attr->sample_type & ~(PERF_SAMPLE_MAX - 1)) { pr_warni...
[ 1, 0 ]
Linux Kernel
tools/perf/util/header.c
static struct evsel *read_event_desc(struct feat_fd *ff) { struct evsel *evsel, *events = NULL; u64 *id; void *buf = NULL; u32 nre, sz, nr, i, j; size_t msz; if (do_read_u32(ff, &nre)) goto error; if (do_read_u32(ff, &sz)) goto error; /* buffer to hold on file attr struct */ buf = malloc(sz...
[ 1, 0 ]
Linux Kernel
tools/perf/util/header.c
static void print_event_desc(struct feat_fd *ff, FILE *fp) { struct evsel *evsel, *events; u32 j; u64 *id; if (ff->events) events = ff->events; else events = read_event_desc(ff); if (!events) { fprintf(fp, "# event desc: not available or unable to read\n"); return; } for (evsel = eve...
[ 0, 0 ]
Linux Kernel
tools/perf/util/header.c
static void print_cpuid(struct feat_fd *ff, FILE *fp) { fprintf(fp, "# cpuid : %s\n", ff->ph->env.cpuid); }
[ 1, 0 ]
Linux Kernel
tools/perf/util/header.c
static void print_stat(struct feat_fd *ff __maybe_unused, FILE *fp) { fprintf(fp, "# contains stat data\n"); }
[ 0, 0 ]
Linux Kernel
tools/perf/util/header.c
static void print_sample_time(struct feat_fd *ff, FILE *fp) { struct perf_session *session; char time_buf[32]; double d; session = container_of(ff->ph, struct perf_session, header); timestamp__scnprintf_usec(session->evlist->first_sample_time, time_buf, sizeof(time_buf)); fpri...
[ 1, 0 ]
Linux Kernel
tools/perf/util/header.c
static void print_mem_topology(struct feat_fd *ff, FILE *fp) { struct memory_node *nodes; int i, nr; nodes = ff->ph->env.memory_nodes; nr = ff->ph->env.nr_memory_nodes; fprintf(fp, "# memory nodes (nr %d, block size 0x%llx):\n", nr, ff->ph->env.memory_bsize); for (i = 0; i < nr; i++) { mem...
[ 0, 0 ]
Linux Kernel
tools/perf/util/header.c
static int process_tracing_data(struct feat_fd *ff, void *data) { ssize_t ret = trace_report(ff->fd, data, false); return ret < 0 ? -1 : 0; }
[ 0, 0 ]
Linux Kernel
tools/perf/util/header.c
static int process_nrcpus(struct feat_fd *ff, void *data __maybe_unused) { int ret; u32 nr_cpus_avail, nr_cpus_online; ret = do_read_u32(ff, &nr_cpus_avail); if (ret) return ret; ret = do_read_u32(ff, &nr_cpus_online); if (ret) return ret; ff->ph->env.nr_cpus_avail = (int)nr_cpus_avail; ff->p...
[ 0, 0 ]
Linux Kernel
tools/perf/util/header.c
static int process_cmdline(struct feat_fd *ff, void *data __maybe_unused) { char *str, *cmdline = NULL, **argv = NULL; u32 nr, i, len = 0; if (do_read_u32(ff, &nr)) return -1; ff->ph->env.nr_cmdline = nr; cmdline = zalloc(ff->size + nr + 1); if (!cmdline) return -1; argv = zalloc(sizeof(char ...
[ 1, 0 ]
Linux Kernel
tools/perf/util/header.c
static int process_pmu_mappings(struct feat_fd *ff, void *data __maybe_unused) { char *name; u32 pmu_num; u32 type; struct strbuf sb; if (do_read_u32(ff, &pmu_num)) return -1; if (!pmu_num) { pr_debug("pmu mappings not available\n"); return 0; } ff->ph->env.nr_pmu_mappings = pmu_num; if...
[ 1, 0 ]
Linux Kernel
tools/perf/util/header.c
static int process_mem_topology(struct feat_fd *ff, void *data __maybe_unused) { struct memory_node *nodes; u64 version, i, nr, bsize; int ret = -1; if (do_read_u64(ff, &version)) return -1; if (version != 1) return -1; if (do_read_u64(ff, &bsize)) return -1; if (do_read_u64(ff, &nr)) ...
[ 1, 0 ]
Linux Kernel
tools/perf/util/header.c
static int process_bpf_btf(struct feat_fd *ff, void *data __maybe_unused) { struct perf_env *env = &ff->ph->env; struct btf_node *node = NULL; u32 count, i; int err = -1; if (ff->ph->needs_swap) { pr_warning( "interpreting btf from systems with endianness is not yet supported\n"); return 0; ...
[ 1, 0 ]
Linux Kernel
tools/perf/util/header.c
static int process_cpu_pmu_caps(struct feat_fd *ff, void *data __maybe_unused) { int ret = __process_pmu_caps(ff, &ff->ph->env.nr_cpu_pmu_caps, &ff->ph->env.cpu_pmu_caps, &ff->ph->env.max_branches); if (!ret && !ff->ph->env.cpu_pmu_caps) pr_debug("cpu pmu capabilities not availa...
[ 1, 0 ]
Linux Kernel
tools/perf/util/header.c
int perf_header__fprintf_info(struct perf_session *session, FILE *fp, bool full) { struct header_print_data hd; struct perf_header *header = &session->header; int fd = perf_data__fd(session->data); struct stat st; time_t stctime; int ret, bit; hd.fp = fp; hd.full = full; ...
[ 0, 0 ]
Linux Kernel
tools/perf/util/header.c
static int perf_header__adds_write(struct perf_header *header, struct evlist *evlist, int fd, struct feat_copier *fc) { int nr_sections; struct feat_fd ff; struct perf_file_section *feat_sec, *p; int sec_size; u64 sec_start; int feat; i...
[ 1, 0 ]
Linux Kernel
tools/perf/util/header.c
size_t perf_session__data_offset(const struct evlist *evlist) { struct evsel *evsel; size_t data_offset; data_offset = sizeof(struct perf_file_header); evlist__for_each_entry(evlist, evsel) { data_offset += evsel->core.ids * sizeof(u64); } data_offset += evlist->core.nr_entries * sizeof(struct perf_fi...
[ 1, 0 ]
Linux Kernel
tools/perf/util/header.c
int perf_header__process_sections( struct perf_header *header, int fd, void *data, int (*process)(struct perf_file_section *section, struct perf_header *ph, int feat, int fd, void *data)) { struct perf_file_section *feat_sec, *sec; int nr_sections; int sec_size; int feat; int err; ...
[ 1, 0 ]
Linux Kernel
tools/perf/util/header.c
static int try_all_pipe_abis(uint64_t hdr_sz, struct perf_header *ph) { u64 attr_size; int i; for (i = 0; attr_pipe_abi_sizes[i]; i++) { if (hdr_sz != attr_pipe_abi_sizes[i]) { attr_size = bswap_64(hdr_sz); if (attr_size != hdr_sz) continue; ph->needs_swap = true; } pr_debu...
[ 0, 0 ]
Linux Kernel
tools/perf/util/header.c
static int perf_file_section__process(struct perf_file_section *section, struct perf_header *ph, int feat, int fd, void *data) { struct feat_fd fdd = { .fd = fd, .ph = ph, .size = section->size, .offset = section->off...
[ 0, 0 ]
Linux Kernel
tools/perf/util/header.c
static int perf_file_header__read_pipe(struct perf_pipe_file_header *header, struct perf_header *ph, struct perf_data *data, bool repipe, int repipe_fd) { struct feat_fd ff = { .fd = repipe_fd, ...
[ 1, 0 ]
Linux Kernel
tools/perf/util/header.c
static int perf_header__read_pipe(struct perf_session *session, int repipe_fd) { struct perf_header *header = &session->header; struct perf_pipe_file_header f_header; if (perf_file_header__read_pipe(&f_header, header, session->data, session->repipe, repipe_fd) < 0) { pr_deb...
[ 1, 0 ]