Projectname
large_stringclasses
15 values
Filepath
large_stringlengths
4
106
⌀
Function
large_stringlengths
11
3.45k
Label
list
Linux Kernel
tools/perf/builtin-kmem.c
static int parse_slab_opt(const struct option *opt __maybe_unused, const char *arg __maybe_unused, int unset __maybe_unused) { kmem_slab = (kmem_page + 1); return 0; }
[ 0, 0 ]
Linux Kernel
tools/perf/builtin-kvm.c
static const char *get_filename_for_perf_kvm(void) { const char *filename; if (perf_host && !perf_guest) filename = strdup("perf.data.host"); else if (!perf_host && perf_guest) filename = strdup("perf.data.guest"); else filename = strdup("perf.data.kvm"); return filename; }
[ 0, 0 ]
Linux Kernel
tools/perf/builtin-kvm.c
bool kvm_exit_event(struct evsel *evsel) { return !strcmp(evsel->name, kvm_exit_trace); }
[ 0, 0 ]
Linux Kernel
tools/perf/builtin-kvm.c
void exit_event_decode_key(struct perf_kvm_stat *kvm, struct event_key *key, char *decode) { const char *exit_reason = get_exit_reason(kvm, key->exit_reasons, key->key); scnprintf(decode, decode_str_len, "%s", exit_reason); }
[ 0, 0 ]
Linux Kernel
tools/perf/builtin-kvm.c
static bool kvm_event_expand(struct kvm_event *event, int vcpu_id) { int old_max_vcpu = event->max_vcpu; void *prev; if (vcpu_id < event->max_vcpu) return true; while (event->max_vcpu <= vcpu_id) event->max_vcpu += DEFAULT_VCPU_NUM; prev = event->vcpu; event->vcpu = realloc(event->vcpu, event->m...
[ 1, 0 ]
Linux Kernel
tools/perf/builtin-kvm.c
static struct kvm_event *kvm_alloc_init_event(struct event_key *key) { struct kvm_event *event; event = zalloc(sizeof(*event)); if (!event) { pr_err("Not enough memory\n"); return NULL; } event->key = *key; init_stats(&event->total.stats); return event; }
[ 0, 0 ]
Linux Kernel
tools/perf/builtin-kvm.c
static bool handle_begin_event(struct perf_kvm_stat *kvm, struct vcpu_event_record *vcpu_record, struct event_key *key, u64 timestamp) { struct kvm_event *event = NULL; if (key->key != INVALID_KEY) event = find_create_kvm_event(kvm, key); vcpu_r...
[ 0, 0 ]
Linux Kernel
tools/perf/builtin-kvm.c
static bool handle_end_event(struct perf_kvm_stat *kvm, struct vcpu_event_record *vcpu_record, struct event_key *key, struct perf_sample *sample) { struct kvm_event *event; u64 time_begin, time_diff; int vcpu; if (kvm->trace...
[ 1, 0 ]
Linux Kernel
tools/perf/builtin-kvm.c
static bool select_key(struct perf_kvm_stat *kvm) { int i; for (i = 0; keys[i].name; i++) { if (!strcmp(keys[i].name, kvm->sort_key)) { kvm->compare = keys[i].key; return true; } } pr_err("Unknown compare key:%s\n", kvm->sort_key); return false; }
[ 0, 0 ]
Linux Kernel
tools/perf/builtin-kvm.c
static struct kvm_event *pop_from_result(struct rb_root *result) { struct rb_node *node = rb_first(result); if (!node) return NULL; rb_erase(node, result); return container_of(node, struct kvm_event, rb); }
[ 0, 0 ]
Linux Kernel
tools/perf/builtin-kvm.c
static int process_lost_event(struct perf_tool *tool, union perf_event *event __maybe_unused, struct perf_sample *sample __maybe_unused, struct machine *machine __maybe_unused) { struct perf_kvm_stat *kvm = container_of(tool, st...
[ 0, 0 ]
Linux Kernel
tools/perf/builtin-kvm.c
static bool skip_sample(struct perf_kvm_stat *kvm, struct perf_sample *sample) { if (kvm->pid_list && intlist__find(kvm->pid_list, sample->pid) == NULL) return true; return false; }
[ 1, 0 ]
Linux Kernel
tools/perf/builtin-kvm.c
static int kvm_cmd_stat(const char *file_name, int argc, const char **argv) { struct perf_kvm_stat kvm = { .file_name = file_name, .trace_vcpu = -1, .report_event = "vmexit", .sort_key = "sample", }; if (argc == 1) { print_kvm_stat_usage(); goto perf_stat; } if (strlen(arg...
[ 0, 0 ]
Linux Kernel
tools/perf/builtin-kvm.c
int __weak kvm_add_default_arch_event(int *argc __maybe_unused, const char **argv __maybe_unused) { return 0; }
[ 0, 0 ]
Linux Kernel
tools/perf/builtin-kvm.c
static int __cmd_record(const char *file_name, int argc, const char **argv) { int rec_argc, i = 0, j, ret; const char **rec_argv; ret = kvm_add_default_arch_event(&argc, argv); if (ret) return -EINVAL; rec_argc = argc + 2; rec_argv = calloc(rec_argc + 1, sizeof(char *)); rec_argv[i++] = strdup("rec...
[ 1, 0 ]
Linux Kernel
tools/perf/builtin-kwork.c
static int runtime_cmp(struct kwork_work *l, struct kwork_work *r) { if (l->total_runtime > r->total_runtime) return 1; if (l->total_runtime < r->total_runtime) return -1; return 0; }
[ 0, 0 ]
Linux Kernel
tools/perf/builtin-kwork.c
static int work_cmp(struct list_head *list, struct kwork_work *l, struct kwork_work *r) { int ret = 0; struct sort_dimension *sort; BUG_ON(list_empty(list)); list_for_each_entry(sort, list, list) { ret = sort->cmp(l, r); if (ret) return ret; } return ret; }
[ 0, 0 ]
Linux Kernel
tools/perf/builtin-kwork.c
static struct kwork_work *work_findnew(struct rb_root_cached *root, struct kwork_work *key, struct list_head *sort_list) { struct kwork_work *work = work_search(root, key, sort_list); if (work != NULL) return work; work = work_ne...
[ 0, 0 ]
Linux Kernel
tools/perf/builtin-kwork.c
static int work_push_atom(struct perf_kwork *kwork, struct kwork_class *class, enum kwork_trace_type src_type, enum kwork_trace_type dst_type, struct evsel *evsel, struct perf_sample *sample, struct machine *machine, ...
[ 1, 0 ]
Linux Kernel
tools/perf/builtin-kwork.c
static int report_exit_event(struct perf_kwork *kwork, struct kwork_class *class, struct evsel *evsel, struct perf_sample *sample, struct machine *machine) { struct kwork_atom *atom = NULL; struct kwork_work *work = NULL; ato...
[ 0, 0 ]
Linux Kernel
tools/perf/builtin-kwork.c
static int latency_entry_event(struct perf_kwork *kwork, struct kwork_class *class, struct evsel *evsel, struct perf_sample *sample, struct machine *machine) { struct kwork_atom *atom = NULL; struct kwork_work *work = NULL...
[ 0, 0 ]
Linux Kernel
tools/perf/builtin-kwork.c
static void timehist_save_callchain(struct perf_kwork *kwork, struct perf_sample *sample, struct evsel *evsel, struct machine *machine) { struct symbol *sym; struct thread *thread; struct callchain_cursor_n...
[ 1, 0 ]
Linux Kernel
tools/perf/builtin-kwork.c
static int process_irq_handler_exit_event(struct perf_tool *tool, struct evsel *evsel, struct perf_sample *sample, struct machine *machine) { struct perf_kwork *kwork = container_of(tool, str...
[ 0, 0 ]
Linux Kernel
tools/perf/builtin-kwork.c
static int irq_class_init(struct kwork_class *class, struct perf_session *session) { if (perf_session__set_tracepoints_handlers(session, irq_tp_handlers)) { pr_err("Failed to set irq tracepoints handlers\n"); return -1; } class->work_root = RB_ROOT_CACHED; return 0; }
[ 0, 0 ]
Linux Kernel
tools/perf/builtin-kwork.c
static int softirq_class_init(struct kwork_class *class, struct perf_session *session) { if (perf_session__set_tracepoints_handlers(session, softirq_tp_handlers)) { pr_err("Failed to set softirq tracepoints handlers\n"); return -1; } class->work_root = RB_ROOT_CACHED; ret...
[ 0, 0 ]
Linux Kernel
tools/perf/builtin-kwork.c
static void softirq_work_name(struct kwork_work *work, char *buf, int len) { snprintf(buf, len, "(s)%s:%" PRIu64 "", work->name, work->id); }
[ 1, 0 ]
Linux Kernel
tools/perf/builtin-kwork.c
static int process_workqueue_activate_work_event(struct perf_tool *tool, struct evsel *evsel, struct perf_sample *sample, struct machine *machine) { struct perf_kwork *kwo...
[ 0, 0 ]
Linux Kernel
tools/perf/builtin-kwork.c
static int process_workqueue_execute_start_event(struct perf_tool *tool, struct evsel *evsel, struct perf_sample *sample, struct machine *machine) { struct perf_kwork *kw...
[ 0, 0 ]
Linux Kernel
tools/perf/builtin-kwork.c
static int process_workqueue_execute_end_event(struct perf_tool *tool, struct evsel *evsel, struct perf_sample *sample, struct machine *machine) { struct perf_kwork *kwork = co...
[ 0, 0 ]
Linux Kernel
tools/perf/builtin-kwork.c
static int workqueue_class_init(struct kwork_class *class, struct perf_session *session) { if (perf_session__set_tracepoints_handlers(session, workqueue_tp_handlers)) { pr_err("Failed to set workqueue tracepoints handlers\n"); return -1; } class->work_root = RB_ROOT_CACHE...
[ 0, 0 ]
Linux Kernel
tools/perf/builtin-kwork.c
static void workqueue_work_init(struct kwork_class *class, struct kwork_work *work, struct evsel *evsel, struct perf_sample *sample, struct machine *machine) { char *modp = NULL; unsigned long long function_addr = evsel...
[ 1, 0 ]
Linux Kernel
tools/perf/builtin-kwork.c
static void workqueue_work_name(struct kwork_work *work, char *buf, int len) { if (work->name != NULL) snprintf(buf, len, "(w)%s", work->name); else snprintf(buf, len, "(w)0x%" PRIx64, work->id); }
[ 0, 0 ]
Linux Kernel
tools/perf/builtin-kwork.c
static void timehist_print_header(void) { printf(" %-*s %-*s %-*s %-*s %-*s %-*s\n", PRINT_TIMESTAMP_WIDTH, "Runtime start", PRINT_TIMESTAMP_WIDTH, "Runtime end", PRINT_TIMEHIST_CPU_WIDTH, "Cpu", PRINT_KWORK_NAME_WIDTH, "Kwork name", PRINT_RUNTIME_WIDTH, "Runtime", PRINT_RUNTIME_WIDTH...
[ 0, 0 ]
Linux Kernel
tools/perf/builtin-kwork.c
static int perf_kwork__timehist(struct perf_kwork *kwork) { kwork->tool.comm = perf_event__process_comm; kwork->tool.exit = perf_event__process_exit; kwork->tool.fork = perf_event__process_fork; kwork->tool.attr = perf_event__process_attr; kwork->tool.tracing_data = perf_event__process_tracing_data; kwork-...
[ 0, 0 ]
Linux Kernel
tools/perf/builtin-kwork.c
static void setup_event_list(struct perf_kwork *kwork, const struct option *options, const char *const usage_msg[]) { int i; struct kwork_class *class; char *tmp, *tok, *str; if (kwork->event_list_str == NULL) goto null_event_list_str; str = strd...
[ 1, 0 ]
Linux Kernel
tools/perf/builtin-lock.c
static int setup_output_field(bool contention, const char *str) { char *tok, *tmp, *orig; int i, ret = 0; struct lock_key *keys = report_keys; if (contention) keys = contention_keys; if (str == NULL) { for (i = 0; keys[i].name; i++) list_add_tail(&keys[i].list, &lock_keys); return 0; } ...
[ 1, 0 ]
Linux Kernel
tools/perf/builtin-lock.c
static void insert_to_result(struct lock_stat *st, int (*bigger)(struct lock_stat *, struct lock_stat *)) { struct rb_node **rb = &result.rb_node; struct rb_node *parent = NULL; struct lock_stat *p; if (combine_locks && st->combined) ...
[ 1, 0 ]
Linux Kernel
tools/perf/builtin-lock.c
static struct lock_stat *pop_from_result(void) { struct rb_node *node = result.rb_node; if (!node) return NULL; while (node->rb_left) node = node->rb_left; rb_erase(node, &result); return container_of(node, struct lock_stat, rb); }
[ 0, 0 ]
Linux Kernel
tools/perf/builtin-lock.c
static struct lock_stat *lock_stat_findnew(u64 addr, const char *name, int flags) { struct hlist_head *entry = lockhashentry(addr); struct lock_stat *ret, *new; hlist_for_each_entry(ret, entry, hash_entry) { if (ret->addr == addr) return ret; } new = zal...
[ 1, 0 ]
Linux Kernel
tools/perf/builtin-lock.c
static struct lock_seq_stat *get_seq(struct thread_stat *ts, u64 addr) { struct lock_seq_stat *seq; list_for_each_entry(seq, &ts->seq_list, list) { if (seq->addr == addr) return seq; } seq = zalloc(sizeof(struct lock_seq_stat)); if (!seq) { pr_err("memory allocation failed\n"); return NUL...
[ 0, 0 ]
Linux Kernel
tools/perf/builtin-lock.c
static u64 *get_callstack(struct perf_sample *sample, int max_stack) { u64 *callstack; u64 i; int c; callstack = calloc(max_stack, sizeof(*callstack)); if (callstack == NULL) return NULL; for (i = 0, c = 0; i < sample->callchain->nr && c < max_stack; i++) { u64 ip = sample->callchain->ips[i]; ...
[ 1, 0 ]
Linux Kernel
tools/perf/builtin-lock.c
static int report_lock_contention_begin_event(struct evsel *evsel, struct perf_sample *sample) { struct lock_stat *ls; struct thread_stat *ts; struct lock_seq_stat *seq; u64 addr = evsel__intval(evsel, sample, "lock_addr"); u64 key; int ret; ret = get_key_by_...
[ 1, 0 ]
Linux Kernel
tools/perf/builtin-lock.c
static int evsel__process_lock_release(struct evsel *evsel, struct perf_sample *sample) { if (trace_handler->release_event) return trace_handler->release_event(evsel, sample); return 0; }
[ 0, 0 ]
Linux Kernel
tools/perf/builtin-lock.c
static int evsel__process_contention_begin(struct evsel *evsel, struct perf_sample *sample) { if (trace_handler->contention_begin_event) return trace_handler->contention_begin_event(evsel, sample); return 0; }
[ 0, 0 ]
Linux Kernel
tools/perf/builtin-lock.c
static void print_bad_events(int bad, int total) { int i; int broken = 0; const char *name[4] = {"acquire", "acquired", "contended", "release"}; for (i = 0; i < BROKEN_MAX; i++) broken += bad_hist[i]; if (quiet || (broken == 0 && !verbose)) return; pr_info("\n=== output for debug===\n\n"); pr_...
[ 0, 0 ]
Linux Kernel
tools/perf/builtin-lock.c
static void print_result(void) { struct lock_stat *st; struct lock_key *key; char cut_name[20]; int bad, total, printed; if (!quiet) { pr_info("%20s ", "Name"); list_for_each_entry(key, &lock_keys, list) pr_info("%*s ", key->len, key->header); pr_info("\n\n"); } bad = total = printed...
[ 1, 1 ]
Linux Kernel
tools/perf/builtin-lock.c
static void dump_map(void) { unsigned int i; struct lock_stat *st; pr_info("Address of instance: name of class\n"); for (i = 0; i < LOCKHASH_SIZE; i++) { hlist_for_each_entry(st, &lockhash_table[i], hash_entry) { insert_to_result(st, compare_maps); } } while ((st = pop_from_result())) p...
[ 1, 0 ]
Linux Kernel
tools/perf/builtin-lock.c
static int process_sample_event(struct perf_tool *tool __maybe_unused, union perf_event *event, struct perf_sample *sample, struct evsel *evsel, struct machine *machine) { int err = 0; struct thread *thread = mach...
[ 0, 0 ]
Linux Kernel
tools/perf/builtin-lock.c
static const char *get_type_str(struct lock_stat *st) { static const struct { unsigned int flags; const char *name; } table[] = { {0, "semaphore"}, {LCB_F_SPIN, "spinlock"}, {LCB_F_SPIN | LCB_F_READ, "rwlock:R"}, {LCB_F_SPIN | LCB_F_WRITE, "rwlock:W"}, {LCB_F_READ, "rwsem:R"},...
[ 1, 0 ]
Linux Kernel
tools/perf/builtin-lock.c
static int __cmd_report(bool display_info) { int err = -EINVAL; struct perf_tool eops = { .sample = process_sample_event, .comm = perf_event__process_comm, .mmap = perf_event__process_mmap, .namespaces = perf_event__process_namespaces, .ordered_events = true, }; struct perf_data da...
[ 1, 0 ]
Linux Kernel
tools/perf/builtin-lock.c
static void sighandler(int sig __maybe_unused) {}
[ 0, 0 ]
Linux Kernel
tools/perf/builtin-mem.c
static int dump_raw_samples(struct perf_tool *tool, union perf_event *event, struct perf_sample *sample, struct machine *machine) { struct perf_mem *mem = container_of(tool, struct perf_mem, tool); struct addr_location al; const char *fmt, *field_sep; cha...
[ 1, 0 ]
Linux Kernel
tools/perf/builtin-mem.c
static int process_sample_event(struct perf_tool *tool, union perf_event *event, struct perf_sample *sample, struct evsel *evsel __maybe_unused, struct machine *machine) { return dump_raw_samples(tool, event, sample, mach...
[ 0, 0 ]
Linux Kernel
tools/perf/builtin-mem.c
static int report_raw_events(struct perf_mem *mem) { struct itrace_synth_opts itrace_synth_opts = { .set = true, .mem = true, .default_no_sample = true, }; struct perf_data data = { .path = input_name, .mode = PERF_DATA_MODE_READ, .force = mem->force, }; int ret; struct ...
[ 0, 0 ]
Linux Kernel
tools/perf/builtin-mem.c
static int report_events(int argc, const char **argv, struct perf_mem *mem) { const char **rep_argv; int ret, i = 0, j, rep_argc; char *new_sort_order; if (mem->dump_raw) return report_raw_events(mem); rep_argc = argc + 3; rep_argv = calloc(rep_argc + 1, sizeof(char *)); if (!rep_argv) return -1...
[ 1, 0 ]
Linux Kernel
tools/perf/builtin-mem.c
static int parse_mem_ops(const struct option *opt, const char *str, int unset) { int *mode = (int *)opt->value; const struct mem_mode *m; char *s, *os = NULL, *p; int ret = -1; if (unset) return 0; if (str) { /* because str is read-only */ s = os = strdup(str); if (!s) return -1; ...
[ 1, 0 ]
Linux Kernel
tools/perf/builtin-probe.c
static int set_target(const char *ptr) { int found = 0; const char *buf; /* * The first argument after options can be an absolute path * to an executable / library or kernel module. * * TODO: Support relative path, and $PATH, $LD_LIBRARY_PATH, * short module name. */ if (!params.target && ptr...
[ 1, 1 ]
Linux Kernel
tools/perf/builtin-probe.c
static int opt_show_vars(const struct option *opt, const char *str, int unset __maybe_unused) { struct perf_probe_event *pev = &params.events[params.nevents]; int ret; if (!str) return 0; ret = parse_probe_event(str); if (!ret && pev->nargs != 0) { pr_err(" Error: '--vars'...
[ 1, 0 ]
Linux Kernel
tools/perf/builtin-probe.c
static void cleanup_params(void) { int i; for (i = 0; i < params.nevents; i++) clear_perf_probe_event(params.events + i); line_range__clear(&params.line_range); free(params.target); strfilter__delete(params.filter); nsinfo__put(params.nsi); memset(&params, 0, sizeof(params)); }
[ 1, 0 ]
Linux Kernel
tools/perf/builtin-probe.c
static void pr_err_with_code(const char *msg, int err) { char sbuf[STRERR_BUFSIZE]; pr_err("%s", msg); pr_debug(" Reason: %s (Code: %d)", str_error_r(-err, sbuf, sizeof(sbuf)), err); pr_err("\n"); }
[ 1, 0 ]
Linux Kernel
tools/perf/builtin-record.c
static inline pid_t gettid(void) { return (pid_t)syscall(__NR_gettid); } #endif
[ 0, 0 ]
Linux Kernel
tools/perf/builtin-record.c
static int record__aio_complete(struct mmap *md, struct aiocb *cblock) { void *rem_buf; off_t rem_off; size_t rem_size; int rc, aio_errno; ssize_t aio_ret, written; aio_errno = aio_error(cblock); if (aio_errno == EINPROGRESS) return 0; written = aio_ret = aio_return(cblock); if (aio_ret < 0) { ...
[ 0, 0 ]
Linux Kernel
tools/perf/builtin-record.c
static int record__aio_pushfn(struct mmap *map, void *to, void *buf, size_t size) { struct record_aio *aio = to; if (record__comp_enabled(aio->rec)) { size = zstd_compress(aio->rec->session, NULL, aio->data + aio->size, mmap__mmap_len(map) - aio->size, buf...
[ 1, 0 ]
Linux Kernel
tools/perf/builtin-record.c
static void record__aio_mmap_read_sync(struct record *rec __maybe_unused) {} #endif
[ 0, 0 ]
Linux Kernel
tools/perf/builtin-record.c
static int record__mmap_flush_parse(const struct option *opt, const char *str, int unset) { int flush_max; struct record_opts *opts = (struct record_opts *)opt->value; static struct parse_tag tags[] = { {.tag = 'B', .mult = 1}, {.tag = 'K', .mult = 1 << 10}, {...
[ 0, 0 ]
Linux Kernel
tools/perf/builtin-record.c
static void record__sig_exit(void) { if (signr == -1) return; signal(signr, SIG_DFL); raise(signr); }
[ 0, 0 ]
Linux Kernel
tools/perf/builtin-record.c
static int record__auxtrace_mmap_read(struct record *rec, struct mmap *map) { int ret; ret = auxtrace_mmap__read(map, rec->itr, &rec->tool, record__process_auxtrace); if (ret < 0) return ret; if (ret) rec->samples++; return 0; }
[ 0, 0 ]
Linux Kernel
tools/perf/builtin-record.c
static int record__auxtrace_mmap_read_snapshot(struct record *rec, struct mmap *map) { int ret; ret = auxtrace_mmap__read_snapshot(map, rec->itr, &rec->tool, record__process_auxtrace, rec->opts...
[ 0, 0 ]
Linux Kernel
tools/perf/builtin-record.c
static void record__read_auxtrace_snapshot(struct record *rec, bool on_exit) { pr_debug("Recording AUX area tracing snapshot\n"); if (record__auxtrace_read_snapshot_all(rec) < 0) { trigger_error(&auxtrace_snapshot_trigger); } else { if (auxtrace_record__snapshot_finish(rec->itr, on_exit)) trigger_e...
[ 0, 0 ]
Linux Kernel
tools/perf/builtin-record.c
static int record__auxtrace_init(struct record *rec) { int err; if ((rec->opts.auxtrace_snapshot_opts || rec->opts.auxtrace_sample_opts) && record__threads_enabled(rec)) { pr_err("AUX area tracing options are not available in parallel streaming " "mode.\n"); return -EINVAL; } if (!re...
[ 1, 0 ]
Linux Kernel
tools/perf/builtin-record.c
static inline int record__auxtrace_mmap_read(struct record *rec __maybe_unused, struct mmap *map __maybe_unused) { return 0; }
[ 0, 0 ]
Linux Kernel
tools/perf/builtin-record.c
static int record__auxtrace_init(struct record *rec __maybe_unused) { return 0; } #endif
[ 0, 0 ]
Linux Kernel
tools/perf/builtin-record.c
static bool record__kcore_readable(struct machine *machine) { char kcore[PATH_MAX]; int fd; scnprintf(kcore, sizeof(kcore), "%s/proc/kcore", machine->root_dir); fd = open(kcore, O_RDONLY); if (fd < 0) return false; close(fd); return true; }
[ 1, 0 ]
Linux Kernel
tools/perf/builtin-record.c
static void record__thread_data_close_pipes(struct record_thread *thread_data) { if (thread_data->pipes.msg[0] != -1) { close(thread_data->pipes.msg[0]); thread_data->pipes.msg[0] = -1; } if (thread_data->pipes.msg[1] != -1) { close(thread_data->pipes.msg[1]); thread_data->pipes.msg[1] = -1; } ...
[ 1, 0 ]
Linux Kernel
tools/perf/builtin-record.c
static bool evlist__per_thread(struct evlist *evlist) { return cpu_map__is_dummy(evlist->core.user_requested_cpus); }
[ 0, 0 ]
Linux Kernel
tools/perf/builtin-record.c
static void record__thread_munmap_filtered(struct fdarray *fda, int fd, void *arg __maybe_unused) { struct perf_mmap *map = fda->priv[fd].ptr; if (map) perf_mmap__put(map); }
[ 0, 0 ]
Linux Kernel
tools/perf/builtin-record.c
static void *record__thread(void *arg) { enum thread_msg msg = THREAD_MSG__READY; bool terminate = false; struct fdarray *pollfd; int err, ctlfd_pos; thread = arg; thread->tid = gettid(); err = write(thread->pipes.ack[1], &msg, sizeof(msg)); if (err == -1) pr_warning("threads[%d]: failed to notify...
[ 1, 0 ]
Linux Kernel
tools/perf/builtin-record.c
static void record__init_features(struct record *rec) { struct perf_session *session = rec->session; int feat; for (feat = HEADER_FIRST_FEATURE; feat < HEADER_LAST_FEATURE; feat++) perf_header__set_feat(&session->header, feat); if (rec->no_buildid) perf_header__clear_feat(&session->header, HEADER_BUI...
[ 1, 0 ]
Linux Kernel
tools/perf/builtin-record.c
static void record__finish_output(struct record *rec) { int i; struct perf_data *data = &rec->data; int fd = perf_data__fd(data); if (data->is_pipe) return; rec->session->header.data_size += rec->bytes_written; data->file.size = lseek(perf_data__fd(data), 0, SEEK_CUR); if (record__threads_enabled(r...
[ 1, 0 ]
Linux Kernel
tools/perf/builtin-record.c
static int write_finished_init(struct record *rec, bool tail) { if (rec->opts.tail_synthesize != tail) return 0; return record__write(rec, NULL, &finished_init_event, sizeof(finished_init_event)); }
[ 1, 0 ]
Linux Kernel
tools/perf/builtin-record.c
static void __record__read_lost_samples(struct record *rec, struct evsel *evsel, struct perf_record_lost_samples *lost, int cpu_idx, int thread_idx) { struct perf_counts_values count; struct perf_sample_id *sid; struct perf_sample sa...
[ 1, 0 ]
Linux Kernel
tools/perf/builtin-record.c
static const struct perf_event_mmap_page * evlist__pick_pc(struct evlist *evlist) { if (evlist) { if (evlist->mmap && evlist->mmap[0].core.base) return evlist->mmap[0].core.base; if (evlist->overwrite_mmap && evlist->overwrite_mmap[0].core.base) return evlist->overwrite_mmap[0].core.base; } r...
[ 1, 0 ]
Linux Kernel
tools/perf/builtin-record.c
static const struct perf_event_mmap_page *record__pick_pc(struct record *rec) { const struct perf_event_mmap_page *pc = evlist__pick_pc(rec->evlist); if (pc) return pc; return NULL; }
[ 0, 0 ]
Linux Kernel
tools/perf/builtin-record.c
static int record__setup_sb_evlist(struct record *rec) { struct record_opts *opts = &rec->opts; if (rec->sb_evlist != NULL) { evlist__set_cb(rec->sb_evlist, record__process_signal_event, rec); rec->thread_id = pthread_self(); } #ifdef HAVE_LIBBPF_SUPPORT if (!opts->no_bpf_event) { if (rec->sb_evli...
[ 0, 0 ]
Linux Kernel
tools/perf/builtin-record.c
static int record__init_clock(struct record *rec) { struct perf_session *session = rec->session; struct timespec ref_clockid; struct timeval ref_tod; u64 ref; if (!rec->opts.use_clockid) return 0; if (rec->opts.use_clockid && rec->opts.clockid_res_ns) session->header.env.clock.clockid_res_ns = re...
[ 1, 0 ]
Linux Kernel
tools/perf/builtin-record.c
static void record__uniquify_name(struct record *rec) { struct evsel *pos; struct evlist *evlist = rec->evlist; char *new_name; int ret; if (!perf_pmu__has_hybrid()) return; evlist__for_each_entry(evlist, pos) { if (!evsel__is_hybrid(pos)) continue; if (strchr(pos->name, '/')) co...
[ 1, 0 ]
Linux Kernel
tools/perf/builtin-record.c
static int record__terminate_thread(struct record_thread *thread_data) { int err; enum thread_msg ack = THREAD_MSG__UNDEFINED; pid_t tid = thread_data->tid; close(thread_data->pipes.msg[1]); thread_data->pipes.msg[1] = -1; err = read(thread_data->pipes.ack[0], &ack, sizeof(ack)); if (err > 0) pr_deb...
[ 1, 0 ]
Linux Kernel
tools/perf/builtin-record.c
static unsigned long record__waking(struct record *rec) { int t; unsigned long waking = 0; struct record_thread *thread_data = rec->thread_data; for (t = 0; t < rec->nr_threads; t++) waking += thread_data[t].waking; return waking; }
[ 1, 0 ]
Linux Kernel
tools/perf/builtin-record.c
static int record__thread_mask_alloc(struct thread_mask *mask, int nr_bits) { int ret; ret = record__mmap_cpu_mask_alloc(&mask->maps, nr_bits); if (ret) { mask->affinity.bits = NULL; return ret; } ret = record__mmap_cpu_mask_alloc(&mask->affinity, nr_bits); if (ret) { record__mmap_cpu_mask_fr...
[ 0, 0 ]
Linux Kernel
tools/perf/builtin-record.c
void __weak arch__add_leaf_frame_record_opts(struct record_opts *opts __maybe_unused) {}
[ 0, 0 ]
Linux Kernel
tools/perf/builtin-record.c
static int parse_control_option(const struct option *opt, const char *str, int unset __maybe_unused) { struct record_opts *opts = opt->value; return evlist__parse_control(str, &opts->ctl_fd, &opts->ctl_fd_ack, &opts->ctl_fd_close); }
[ 0, 0 ]
Linux Kernel
tools/perf/builtin-record.c
static int build_id__process_mmap2(struct perf_tool *tool, union perf_event *event, struct perf_sample *sample, struct machine *machine) { if (!(event->header.misc & PERF_RECORD_MISC_USER)) return 0; retur...
[ 0, 0 ]
Linux Kernel
tools/perf/builtin-record.c
static int parse_record_synth_option(const struct option *opt, const char *str, int unset __maybe_unused) { struct record_opts *opts = opt->value; char *p = strdup(str); if (p == NULL) return -1; opts->synth = parse_synth_opt(p); free(p); if (opts->synth < 0) { ...
[ 1, 0 ]
Linux Kernel
tools/perf/builtin-record.c
static int record__mmap_cpu_mask_init(struct mmap_cpu_mask *mask, struct perf_cpu_map *cpus) { struct perf_cpu cpu; int idx; if (cpu_map__is_dummy(cpus)) return 0; perf_cpu_map__for_each_cpu(cpu, idx, cpus) { if (cpu.cpu == -1) continue; if ((unsigned l...
[ 0, 0 ]
Linux Kernel
tools/perf/builtin-record.c
static int record__mmap_cpu_mask_init_spec(struct mmap_cpu_mask *mask, const char *mask_spec) { struct perf_cpu_map *cpus; cpus = perf_cpu_map__new(mask_spec); if (!cpus) return -ENOMEM; bitmap_zero(mask->bits, mask->nbits); if (record__mmap_cpu_mask_init(mask...
[ 0, 0 ]
Linux Kernel
tools/perf/builtin-record.c
static int record__alloc_thread_masks(struct record *rec, int nr_threads, int nr_bits) { int t, ret; rec->thread_masks = zalloc(nr_threads * sizeof(*(rec->thread_masks))); if (!rec->thread_masks) { pr_err("Failed to allocate thread masks\n"); return -ENOMEM; } ...
[ 1, 0 ]
Linux Kernel
tools/perf/builtin-record.c
static int record__init_thread_cpu_masks(struct record *rec, struct perf_cpu_map *cpus) { int t, ret, nr_cpus = perf_cpu_map__nr(cpus); ret = record__alloc_thread_masks(rec, nr_cpus, cpu__max_cpu().cpu); if (ret) return ret; rec->nr_threads = nr_cpus; pr_debug("...
[ 0, 0 ]
Linux Kernel
tools/perf/builtin-record.c
static int record__init_thread_package_masks(struct record *rec, struct perf_cpu_map *cpus) { int ret; struct cpu_topology *topo; topo = cpu_topology__new(); if (!topo) { pr_err("Failed to allocate CPU topology\n"); return -ENOMEM; } ret = record__init...
[ 0, 0 ]
Linux Kernel
tools/perf/builtin-report.c
static int hist_iter__report_callback(struct hist_entry_iter *iter, struct addr_location *al, bool single, void *arg) { int err = 0; struct report *rep = arg; struct hist_entry *he = iter->he; struct evsel *evsel = iter->evsel; struc...
[ 0, 0 ]
Linux Kernel
tools/perf/builtin-report.c
static int process_feature_event(struct perf_session *session, union perf_event *event) { struct report *rep = container_of(session->tool, struct report, tool); if (event->feat.feat_id < HEADER_LAST_FEATURE) return perf_event__process_feature(session, event); if (event->feat...
[ 0, 0 ]