Projectname
large_stringclasses
15 values
Filepath
large_stringlengths
4
106
⌀
Function
large_stringlengths
11
3.45k
Label
list
Linux Kernel
tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c
static int intel_pt_get_long_tnt(const unsigned char *buf, size_t len, struct intel_pt_pkt *packet) { uint64_t payload; int count; if (len < 8) return INTEL_PT_NEED_MORE_BYTES; payload = le64_to_cpu(*(uint64_t *)buf); for (count = 47; count; count--) { if (payload ...
[ 1, 0 ]
Linux Kernel
tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c
static int intel_pt_get_psb(const unsigned char *buf, size_t len, struct intel_pt_pkt *packet) { int i; if (len < 16) return INTEL_PT_NEED_MORE_BYTES; for (i = 2; i < 16; i += 2) { if (buf[i] != 2 || buf[i + 1] != 0x82) return INTEL_PT_BAD_PACKET; } packet->type =...
[ 1, 0 ]
Linux Kernel
tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c
static int intel_pt_get_psbend(struct intel_pt_pkt *packet) { packet->type = INTEL_PT_PSBEND; return 2; }
[ 0, 0 ]
Linux Kernel
tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c
static int intel_pt_get_ptwrite(const unsigned char *buf, size_t len, struct intel_pt_pkt *packet) { packet->count = (buf[1] >> 5) & 0x3; packet->type = buf[1] & BIT(7) ? INTEL_PT_PTWRITE_IP : INTEL_PT_PTWRITE; switch (packet->count) { case 0: if (len < 6) return INTE...
[ 1, 0 ]
Linux Kernel
tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c
static int intel_pt_get_bbp(const unsigned char *buf, size_t len, struct intel_pt_pkt *packet) { if (len < 3) return INTEL_PT_NEED_MORE_BYTES; packet->type = INTEL_PT_BBP; packet->count = buf[2] >> 7; packet->payload = buf[2] & 0x1f; return 3; }
[ 1, 0 ]
Linux Kernel
tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c
static int intel_pt_get_bip_8(const unsigned char *buf, size_t len, struct intel_pt_pkt *packet) { if (len < 9) return INTEL_PT_NEED_MORE_BYTES; packet->type = INTEL_PT_BIP; packet->count = buf[0] >> 3; memcpy_le64(&packet->payload, buf + 1, 8); return 9; }
[ 0, 0 ]
Linux Kernel
tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c
static int intel_pt_get_bep(size_t len, struct intel_pt_pkt *packet) { if (len < 2) return INTEL_PT_NEED_MORE_BYTES; packet->type = INTEL_PT_BEP; return 2; }
[ 0, 0 ]
Linux Kernel
tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c
static int intel_pt_get_bep_ip(size_t len, struct intel_pt_pkt *packet) { if (len < 2) return INTEL_PT_NEED_MORE_BYTES; packet->type = INTEL_PT_BEP_IP; return 2; }
[ 0, 0 ]
Linux Kernel
tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c
static int intel_pt_get_short_tnt(unsigned int byte, struct intel_pt_pkt *packet) { int count; for (count = 6; count; count--) { if (byte & BIT(7)) break; byte <<= 1; } packet->type = INTEL_PT_TNT; packet->count = count; packet->payload = (uint64_t)byte << ...
[ 1, 0 ]
Linux Kernel
tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c
static int intel_pt_do_get_packet(const unsigned char *buf, size_t len, struct intel_pt_pkt *packet, enum intel_pt_pkt_ctx ctx) { unsigned int byte; memset(packet, 0, sizeof(struct intel_pt_pkt)); if (!len) return INTEL_PT_NEED_MORE_BYTES;...
[ 1, 0 ]
Linux Kernel
tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c
int intel_pt_get_packet(const unsigned char *buf, size_t len, struct intel_pt_pkt *packet, enum intel_pt_pkt_ctx *ctx) { int ret; ret = intel_pt_do_get_packet(buf, len, packet, *ctx); if (ret > 0) { while (ret < 8 && len > (size_t)ret && !buf[ret]) ret +...
[ 1, 0 ]
Linux Kernel
tools/perf/util/intel-pt.c
static bool intel_pt_log_events(struct intel_pt *pt, u64 tm) { struct perf_time_interval *range = pt->synth_opts.ptime_range; int n = pt->synth_opts.range_num; if (pt->synth_opts.log_plus_flags & AUXTRACE_LOG_FLG_ALL_PERF_EVTS) return true; if (pt->synth_opts.log_minus_flags & AUXTRACE_LOG_FLG_ALL_PERF_EV...
[ 0, 0 ]
Linux Kernel
tools/perf/util/intel-pt.c
static void intel_pt_free_vmcs_info(struct intel_pt *pt) { struct intel_pt_vmcs_info *v; struct rb_node *n; n = rb_first(&pt->vmcs_info); while (n) { v = rb_entry(n, struct intel_pt_vmcs_info, rb_node); n = rb_next(n); rb_erase(&v->rb_node, &pt->vmcs_info); free(v); } }
[ 1, 0 ]
Linux Kernel
tools/perf/util/intel-pt.c
static int intel_pt_cache_add(struct dso *dso, struct machine *machine, u64 offset, u64 insn_cnt, u64 byte_cnt, struct intel_pt_insn *intel_pt_insn) { struct auxtrace_cache *c = intel_pt_cache(dso, machine); struct intel_pt_cache_entry *e; int err; i...
[ 1, 0 ]
Linux Kernel
tools/perf/util/intel-pt.c
static struct intel_pt_cache_entry * intel_pt_cache_lookup(struct dso *dso, struct machine *machine, u64 offset) { struct auxtrace_cache *c = intel_pt_cache(dso, machine); if (!c) return NULL; return auxtrace_cache__lookup(dso->auxtrace_cache, offset); }
[ 0, 0 ]
Linux Kernel
tools/perf/util/intel-pt.c
static void intel_pt_cache_invalidate(struct dso *dso, struct machine *machine, u64 offset) { struct auxtrace_cache *c = intel_pt_cache(dso, machine); if (!c) return; auxtrace_cache__remove(dso->auxtrace_cache, offset); }
[ 0, 0 ]
Linux Kernel
tools/perf/util/intel-pt.c
static inline bool intel_pt_guest_kernel_ip(uint64_t ip) { return ip & (1ULL << 63); }
[ 0, 0 ]
Linux Kernel
tools/perf/util/intel-pt.c
static inline bool intel_pt_jmp_16(struct intel_pt_insn *intel_pt_insn) { return intel_pt_insn->rel == 16 && intel_pt_insn->branch == INTEL_PT_BR_UNCONDITIONAL; }
[ 1, 0 ]
Linux Kernel
tools/perf/util/intel-pt.c
static bool intel_pt_match_pgd_ip(struct intel_pt *pt, uint64_t ip, uint64_t offset, const char *filename) { struct addr_filter *filt; bool have_filter = false; bool hit_tracestop = false; bool hit_filter = false; list_for_each_entry(filt, &pt->filts.head, list) { if (f...
[ 1, 0 ]
Linux Kernel
tools/perf/util/intel-pt.c
static int __intel_pt_pgd_ip(uint64_t ip, void *data) { struct intel_pt_queue *ptq = data; struct thread *thread; struct addr_location al; u8 cpumode; u64 offset; if (ptq->state->to_nr) { if (intel_pt_guest_kernel_ip(ip)) return intel_pt_match_pgd_ip(ptq->pt, ip, ip, NULL); return -EINVAL; ...
[ 1, 0 ]
Linux Kernel
tools/perf/util/intel-pt.c
static bool intel_pt_return_compression(struct intel_pt *pt) { struct evsel *evsel; u64 config; if (!pt->noretcomp_bit) return true; evlist__for_each_entry(pt->session->evlist, evsel) { if (intel_pt_get_config(pt, &evsel->core.attr, &config) && (config & pt->noretcomp_bit)) return false...
[ 0, 0 ]
Linux Kernel
tools/perf/util/intel-pt.c
static bool intel_pt_branch_enable(struct intel_pt *pt) { struct evsel *evsel; u64 config; evlist__for_each_entry(pt->session->evlist, evsel) { if (intel_pt_get_config(pt, &evsel->core.attr, &config) && (config & INTEL_PT_CFG_PASS_THRU) && !(config & INTEL_PT_CFG_BRANCH_EN)) return false; } ...
[ 0, 0 ]
Linux Kernel
tools/perf/util/intel-pt.c
static unsigned int intel_pt_mtc_period(struct intel_pt *pt) { struct evsel *evsel; unsigned int shift; u64 config; if (!pt->mtc_freq_bits) return 0; for (shift = 0, config = pt->mtc_freq_bits; !(config & 1); shift++) config >>= 1; evlist__for_each_entry(pt->session->evlist, evsel) { if (int...
[ 1, 0 ]
Linux Kernel
tools/perf/util/intel-pt.c
static bool intel_pt_sampling_mode(struct intel_pt *pt) { struct evsel *evsel; evlist__for_each_entry(pt->session->evlist, evsel) { if ((evsel->core.attr.sample_type & PERF_SAMPLE_AUX) && evsel->core.attr.aux_sample_size) return true; } return false; }
[ 0, 0 ]
Linux Kernel
tools/perf/util/intel-pt.c
static struct ip_callchain *intel_pt_alloc_chain(struct intel_pt *pt) { size_t sz = sizeof(struct ip_callchain); sz += (pt->synth_opts.callchain_sz + 1) * sizeof(u64); return zalloc(sz); }
[ 1, 0 ]
Linux Kernel
tools/perf/util/intel-pt.c
static void intel_pt_add_br_stack(struct intel_pt *pt, struct perf_sample *sample) { struct thread *thread = machine__findnew_thread(pt->machine, sample->pid, sample->tid); thread_stack__br_sample_late(thread, sample->cpu, pt->br_stack, pt->br_...
[ 0, 0 ]
Linux Kernel
tools/perf/util/intel-pt.c
static inline bool intel_pt_skip_event(struct intel_pt *pt) { return pt->synth_opts.initial_skip && pt->num_events++ < pt->synth_opts.initial_skip; }
[ 0, 0 ]
Linux Kernel
tools/perf/util/intel-pt.c
static void intel_pt_prep_a_sample(struct intel_pt_queue *ptq, union perf_event *event, struct perf_sample *sample) { event->sample.header.type = PERF_RECORD_SAMPLE; event->sample.header.size = sizeof(struct perf_event_header); sample->pid = ...
[ 1, 0 ]
Linux Kernel
tools/perf/util/intel-pt.c
static int intel_pt_inject_event(union perf_event *event, struct perf_sample *sample, u64 type) { event->header.size = perf_event__sample_event_size(sample, type, 0); return perf_event__synthesize_sample(event, type, 0, sample); }
[ 0, 0 ]
Linux Kernel
tools/perf/util/intel-pt.c
static inline int intel_pt_opt_inject(struct intel_pt *pt, union perf_event *event, struct perf_sample *sample, u64 type) { if (!pt->synth_opts.inject) return 0; return intel_pt_inject_event(event, sample, type); }
[ 0, 0 ]
Linux Kernel
tools/perf/util/intel-pt.c
static int intel_pt_synth_transaction_sample(struct intel_pt_queue *ptq) { struct intel_pt *pt = ptq->pt; union perf_event *event = ptq->event_buf; struct perf_sample sample = { .ip = 0, }; if (intel_pt_skip_event(pt)) return 0; intel_pt_prep_sample(pt, ptq, event, &sample); sample.id = ptq-...
[ 0, 0 ]
Linux Kernel
tools/perf/util/intel-pt.c
static int intel_pt_synth_ptwrite_sample(struct intel_pt_queue *ptq) { struct intel_pt *pt = ptq->pt; union perf_event *event = ptq->event_buf; struct perf_sample sample = { .ip = 0, }; struct perf_synth_intel_ptwrite raw; if (intel_pt_skip_event(pt)) return 0; intel_pt_prep_p_sample(pt, ptq,...
[ 1, 0 ]
Linux Kernel
tools/perf/util/intel-pt.c
static int intel_pt_synth_cbr_sample(struct intel_pt_queue *ptq) { struct intel_pt *pt = ptq->pt; union perf_event *event = ptq->event_buf; struct perf_sample sample = { .ip = 0, }; struct perf_synth_intel_cbr raw; u32 flags; if (intel_pt_skip_cbr_event(pt)) return 0; ptq->cbr_seen = ptq->s...
[ 1, 0 ]
Linux Kernel
tools/perf/util/intel-pt.c
static int intel_pt_synth_pwre_sample(struct intel_pt_queue *ptq) { struct intel_pt *pt = ptq->pt; union perf_event *event = ptq->event_buf; struct perf_sample sample = { .ip = 0, }; struct perf_synth_intel_pwre raw; if (intel_pt_skip_event(pt)) return 0; intel_pt_prep_p_sample(pt, ptq, event...
[ 0, 0 ]
Linux Kernel
tools/perf/util/intel-pt.c
static u64 *intel_pt_add_gp_regs(struct regs_dump *intr_regs, u64 *pos, const struct intel_pt_blk_items *items, u64 regs_mask) { const u64 *gp_regs = items->val[INTEL_PT_GP_REGS_POS]; u32 mask = items->mask[INTEL_PT_GP_REGS_POS]; u32 bit; int i; ...
[ 1, 0 ]
Linux Kernel
tools/perf/util/intel-pt.c
static void intel_pt_add_xmm(struct regs_dump *intr_regs, u64 *pos, const struct intel_pt_blk_items *items, u64 regs_mask) { u32 mask = items->has_xmm & (regs_mask >> PERF_REG_X86_XMM0); const u64 *xmm = items->xmm; intr_regs->mask |= (u64)mask << PERF_RE...
[ 1, 0 ]
Linux Kernel
tools/perf/util/intel-pt.c
static void intel_pt_add_lbrs(struct branch_stack *br_stack, const struct intel_pt_blk_items *items) { u64 *to; int i; br_stack->nr = 0; to = &br_stack->entries[0].from; for (i = INTEL_PT_LBR_0_POS; i <= INTEL_PT_LBR_2_POS; i++) { u32 mask = items->mask[i]; const u64 ...
[ 1, 0 ]
Linux Kernel
tools/perf/util/intel-pt.c
static int intel_pt_synth_single_pebs_sample(struct intel_pt_queue *ptq) { struct intel_pt *pt = ptq->pt; struct evsel *evsel = pt->pebs_evsel; u64 id = evsel->core.id[0]; return intel_pt_do_synth_pebs_sample(ptq, evsel, id); }
[ 0, 0 ]
Linux Kernel
tools/perf/util/intel-pt.c
static int intel_pt_synth_error(struct intel_pt *pt, int code, int cpu, pid_t pid, pid_t tid, u64 ip, u64 timestamp, pid_t machine_pid, int vcpu) { bool dump_log_on_error = pt->synth_opts.log_plus_flags & AUXTRACE_LOG_FLG_ON_ERROR; bool log_on_s...
[ 1, 0 ]
Linux Kernel
tools/perf/util/intel-pt.c
static int intel_pt_next_tid(struct intel_pt *pt, struct intel_pt_queue *ptq) { struct auxtrace_queue *queue; pid_t tid = ptq->next_tid; int err; if (tid == -1) return 0; intel_pt_log("switch: cpu %d tid %d\n", ptq->cpu, tid); err = machine__set_current_tid(pt->machine, ptq->cpu, -1, tid); queue ...
[ 1, 0 ]
Linux Kernel
tools/perf/util/intel-pt.c
static inline bool intel_pt_is_switch_ip(struct intel_pt_queue *ptq, u64 ip) { struct intel_pt *pt = ptq->pt; return ip == pt->switch_ip && (ptq->flags & PERF_IP_FLAG_BRANCH) && !(ptq->flags & (PERF_IP_FLAG_CONDITIONAL | PERF_IP_FLAG_ASYNC | PERF_IP_FLAG_INTERRUPT | PERF_IP_FLAG_...
[ 0, 0 ]
Linux Kernel
tools/perf/util/intel-pt.c
static void intel_pt_enable_sync_switch(struct intel_pt *pt) { unsigned int i; if (pt->sync_switch_not_supported) return; pt->sync_switch = true; for (i = 0; i < pt->queues.nr_queues; i++) { struct auxtrace_queue *queue = &pt->queues.queue_array[i]; struct intel_pt_queue *ptq = queue->priv; ...
[ 0, 0 ]
Linux Kernel
tools/perf/util/intel-pt.c
static inline int intel_pt_update_queues(struct intel_pt *pt) { if (pt->queues.new_data) { pt->queues.new_data = false; return intel_pt_setup_queues(pt); } return 0; }
[ 0, 0 ]
Linux Kernel
tools/perf/util/intel-pt.c
static int intel_pt_lost(struct intel_pt *pt, struct perf_sample *sample) { return intel_pt_synth_error(pt, INTEL_PT_ERR_LOST, sample->cpu, sample->pid, sample->tid, 0, sample->time, sample->machine_pid, sample->vcpu); }
[ 0, 0 ]
Linux Kernel
tools/perf/util/intel-pt.c
static int intel_pt_sync_switch(struct intel_pt *pt, int cpu, pid_t tid, u64 timestamp) { struct intel_pt_queue *ptq; int err; if (!pt->sync_switch) return 1; ptq = intel_pt_cpu_to_ptq(pt, cpu); if (!ptq || !ptq->sync_switch) return 1; switch (ptq->switch_state) {...
[ 0, 0 ]
Linux Kernel
tools/perf/util/intel-pt.c
static int intel_pt_process_itrace_start(struct intel_pt *pt, union perf_event *event, struct perf_sample *sample) { if (!pt->per_cpu_mmaps) return 0; intel_pt_log("itrace_start: cpu %d pid %d tid %d time %" PRIu64 ...
[ 0, 0 ]
Linux Kernel
tools/perf/util/intel-pt.c
static int intel_pt_process_aux_output_hw_id(struct intel_pt *pt, union perf_event *event, struct perf_sample *sample) { u64 hw_id = event->aux_output_hw_id.hw_id; struct auxtrace_queue *queue; struct intel_pt_queue *ptq; ...
[ 1, 0 ]
Linux Kernel
tools/perf/util/intel-pt.c
static int intel_pt_text_poke(struct intel_pt *pt, union perf_event *event) { u8 cpumode = event->header.misc & PERF_RECORD_MISC_CPUMODE_MASK; u64 addr = event->text_poke.addr + event->text_poke.new_len - 1; int cnt = 4096 + event->text_poke.new_len; struct thread *thread = pt->unknown_thread; struct addr_lo...
[ 1, 0 ]
Linux Kernel
tools/perf/util/intel-pt.c
static int intel_pt_queue_data(struct perf_session *session, struct perf_sample *sample, union perf_event *event, u64 data_offset) { struct intel_pt *pt = container_of(session->auxtrace, struct intel_pt, auxtrace); u64 timestamp; if (event) { ...
[ 1, 0 ]
Linux Kernel
tools/perf/util/intel-pt.c
static int intel_pt_synth_event(struct perf_session *session, const char *name, struct perf_event_attr *attr, u64 id) { struct intel_pt_synth intel_pt_synth; int err; pr_debug("Synthesizing '%s' event with id %" PRIu64 " sample type %#" PRIx64 "\n", name, id...
[ 1, 0 ]
Linux Kernel
tools/perf/util/intel-pt.c
static struct evsel *intel_pt_find_sched_switch(struct evlist *evlist) { struct evsel *evsel; evlist__for_each_entry_reverse(evlist, evsel) { const char *name = evsel__name(evsel); if (!strcmp(name, "sched:sched_switch")) return evsel; } return NULL; }
[ 0, 0 ]
Linux Kernel
tools/perf/util/intel-pt.c
static int intel_pt_perf_config(const char *var, const char *value, void *data) { struct intel_pt *pt = data; if (!strcmp(var, "intel-pt.mispred-all")) pt->mispred_all = perf_config_bool(var, value); if (!strcmp(var, "intel-pt.max-loops")) perf_config_int(&pt->max_loops,...
[ 0, 0 ]
Linux Kernel
tools/perf/util/intel-pt.c
static u64 intel_pt_tsc_start(u64 ns, struct intel_pt *pt) { u64 tsc, tm; tsc = perf_time_to_tsc(ns, &pt->tc); while (1) { tm = tsc_to_perf_time(tsc, &pt->tc); if (tm < ns) break; tsc -= 1; } while (tm < ns) tm = tsc_to_perf_time(++tsc, &pt->tc); return tsc; }
[ 0, 0 ]
Linux Kernel
tools/perf/util/intel-pt.c
static void intel_pt_print_info(__u64 *arr, int start, int finish) { int i; if (!dump_trace) return; for (i = start; i <= finish; i++) { const char *fmt = intel_pt_info_fmts[i]; if (fmt) fprintf(stdout, fmt, arr[i]); } }
[ 0, 0 ]
Linux Kernel
tools/perf/util/intel-pt.c
static bool intel_pt_has(struct perf_record_auxtrace_info *auxtrace_info, int pos) { return auxtrace_info->header.size >= sizeof(struct perf_record_auxtrace_info) + (sizeof(u64) * (pos + 1)); }
[ 1, 0 ]
Linux Kernel
tools/perf/util/intlist.c
static struct rb_node *intlist__node_new(struct rblist *rblist __maybe_unused, const void *entry) { unsigned long i = (unsigned long)entry; struct rb_node *rc = NULL; struct int_node *node = malloc(sizeof(*node)); if (node != NULL) { node->i = i; node->priv = N...
[ 1, 0 ]
Linux Kernel
tools/perf/util/intlist.c
struct int_node *intlist__find(struct intlist *ilist, unsigned long i) { return __intlist__findnew(ilist, i, false); }
[ 0, 0 ]
Linux Kernel
tools/perf/util/intlist.c
static int intlist__parse_list(struct intlist *ilist, const char *s) { char *sep; int err; do { unsigned long value = strtol(s, &sep, 10); err = -EINVAL; if (*sep != ',' && *sep != '\0') break; err = intlist__add(ilist, value); if (err) break; s = sep + 1; } while (*sep != ...
[ 1, 0 ]
Linux Kernel
tools/perf/util/intlist.c
void intlist__delete(struct intlist *ilist) { if (ilist != NULL) rblist__delete(&ilist->rblist); }
[ 0, 0 ]
Linux Kernel
tools/perf/util/iostat.c
__weak int iostat_prepare(struct evlist *evlist __maybe_unused, struct perf_stat_config *config __maybe_unused) { return -1; }
[ 0, 0 ]
Linux Kernel
tools/perf/util/iostat.c
__weak void iostat_print_header_prefix(struct perf_stat_config *config __maybe_unused) {}
[ 0, 0 ]
Linux Kernel
tools/perf/util/iostat.c
__weak void iostat_prefix(struct evlist *evlist __maybe_unused, struct perf_stat_config *config __maybe_unused, char *prefix __maybe_unused, struct timespec *ts __maybe_unused) {}
[ 0, 0 ]
Linux Kernel
tools/perf/util/jitdump.c
static int jit_emit_elf(struct jit_buf_desc *jd, char *filename, const char *sym, uint64_t code_addr, const void *code, int csize, void *debug, int nr_debug_entries, void *unwinding, uint32_t unwinding_header_size, uint32_t...
[ 0, 0 ]
Linux Kernel
tools/perf/util/jitdump.c
static int jit_validate_events(struct perf_session *session) { struct evsel *evsel; evlist__for_each_entry(session->evlist, evsel) { if (evsel->core.attr.use_clockid == 0 || evsel->core.attr.clockid != CLOCK_MONOTONIC) return -1; } return 0; }
[ 1, 0 ]
Linux Kernel
tools/perf/util/jitdump.c
static pid_t jr_entry_tid(struct jit_buf_desc *jd, union jr_entry *jr) { if (jd->nsi && nsinfo__in_pidns(jd->nsi)) return nsinfo__pid(jd->nsi); return jr->load.tid; }
[ 0, 0 ]
Linux Kernel
tools/perf/util/jitdump.c
static uint64_t convert_timestamp(struct jit_buf_desc *jd, uint64_t timestamp) { struct perf_tsc_conversion tc = { .time_shift = 0, }; struct perf_record_time_conv *time_conv = &jd->session->time_conv; if (!jd->use_arch_timestamp) return timestamp; tc.time_shift = time_conv->time_shift; tc.time_...
[ 0, 0 ]
Linux Kernel
tools/perf/util/jitdump.c
static int jit_repipe_debug_info(struct jit_buf_desc *jd, union jr_entry *jr) { void *data; size_t sz; if (!(jd && jr)) return -1; sz = jr->prefix.total_size - sizeof(jr->info); data = malloc(sz); if (!data) return -1; memcpy(data, &jr->info.entries, sz); jd->debug_data = data; jd->nr_deb...
[ 1, 0 ]
Linux Kernel
tools/perf/util/jitdump.c
static int jit_detect(char *mmap_name, pid_t pid, struct nsinfo *nsi) { char *p; char *end = NULL; pid_t pid2; if (verbose > 2) fprintf(stderr, "jit marker trying : %s\n", mmap_name); p = strrchr(mmap_name, '/'); if (!p) return -1; /* * match prefix */ if (strncmp(p, "/jit-", 5)) re...
[ 1, 0 ]
Linux Kernel
tools/perf/util/jitdump.c
static bool jit_has_pid(struct machine *machine, pid_t pid) { struct thread *thread = machine__find_thread(machine, pid, pid); if (!thread) return 0; return (bool)thread->priv; }
[ 0, 0 ]
Linux Kernel
tools/perf/util/kwork.h
static inline int perf_kwork__report_read_bpf(struct perf_kwork *kwork __maybe_unused) { return -1; }
[ 0, 0 ]
Linux Kernel
tools/perf/util/kwork.h
static inline void perf_kwork__trace_start(void) {}
[ 0, 0 ]
Linux Kernel
tools/perf/util/kwork.h
static inline void perf_kwork__trace_finish(void) {}
[ 0, 0 ]
Linux Kernel
tools/perf/util/llvm-utils.c
static int search_program(const char *def, const char *name, char *output) { char *env, *path, *tmp = NULL; char buf[PATH_MAX]; int ret; output[0] = '\0'; if (def && def[0] != '\0') { if (def[0] == '/') { if (access(def, F_OK) == 0) { strlcpy(output, def, PATH_MAX); return 0; ...
[ 1, 0 ]
Linux Kernel
tools/perf/util/llvm-utils.c
static int search_program_and_warn(const char *def, const char *name, char *output) { int ret = search_program(def, name, output); if (ret) { pr_err("ERROR:\tunable to find %s.\n" "Hint:\tTry to install latest clang/llvm to support BPF. Check your " "$P...
[ 1, 0 ]
Linux Kernel
tools/perf/util/llvm-utils.c
static int detect_kbuild_dir(char **kbuild_dir) { const char *test_dir = llvm_param.kbuild_dir; const char *prefix_dir = ""; const char *suffix_dir = ""; char release[128]; char *autoconf_path; int err; if (!test_dir) { err = fetch_kernel_version(NULL, release, sizeof(release)); if (err) ...
[ 1, 0 ]
Linux Kernel
tools/perf/util/lock-contention.h
static inline int lock_contention_finish(void) { return 0; }
[ 0, 0 ]
Linux Kernel
tools/perf/util/lzma.c
bool lzma_is_compressed(const char *input) { int fd = open(input, O_RDONLY); const uint8_t magic[6] = {0xFD, '7', 'z', 'X', 'Z', 0x00}; char buf[6] = {0}; ssize_t rc; if (fd < 0) return -1; rc = read(fd, buf, sizeof(buf)); close(fd); return rc == sizeof(buf) ? memcmp(buf, magic, sizeof(buf)) == 0...
[ 1, 0 ]
Linux Kernel
tools/perf/util/machine.c
static void thread__set_guest_comm(struct thread *thread, pid_t pid) { char comm[64]; snprintf(comm, sizeof(comm), "[guest/%d]", pid); thread__set_comm(thread, comm, 0); }
[ 1, 0 ]
Linux Kernel
tools/perf/util/machine.c
struct machine *machine__new_kallsyms(void) { struct machine *machine = machine__new_host(); /* * FIXME: * 1) We should switch to machine__load_kallsyms(), i.e. not explicitly * ask for not using the kcore parsing code, once this one is fixed * to create a map per module. */ if (machine && ma...
[ 1, 1 ]
Linux Kernel
tools/perf/util/machine.c
static void dsos__exit(struct dsos *dsos) { dsos__purge(dsos); exit_rwsem(&dsos->lock); }
[ 0, 0 ]
Linux Kernel
tools/perf/util/machine.c
void machine__exit(struct machine *machine) { int i; if (machine == NULL) return; machine__destroy_kernel_maps(machine); maps__delete(machine->kmaps); dsos__exit(&machine->dsos); machine__exit_vdso(machine); zfree(&machine->root_dir); zfree(&machine->mmap_name); zfree(&machine->current_tid); z...
[ 0, 0 ]
Linux Kernel
tools/perf/util/machine.c
void machines__set_comm_exec(struct machines *machines, bool comm_exec) { struct rb_node *nd; machines->host.comm_exec = comm_exec; for (nd = rb_first_cached(&machines->guests); nd; nd = rb_next(nd)) { struct machine *machine = rb_entry(nd, struct machine, rb_node); machine->comm_exec = comm_exec; }...
[ 0, 0 ]
Linux Kernel
tools/perf/util/machine.c
struct machine *machines__findnew(struct machines *machines, pid_t pid) { char path[PATH_MAX]; const char *root_dir = ""; struct machine *machine = machines__find(machines, pid); if (machine && (machine->pid == pid)) goto out; if ((pid != HOST_KERNEL_ID) && (pid != DEFAULT_GUEST_KERNEL_ID) && (sy...
[ 1, 0 ]
Linux Kernel
tools/perf/util/machine.c
static struct thread *findnew_guest_code(struct machine *machine, struct machine *host_machine, pid_t pid) { struct thread *host_thread; struct thread *thread; int err; if (!machine) return NULL; thread = machine__findnew_...
[ 0, 0 ]
Linux Kernel
tools/perf/util/machine.c
void machines__process_guests(struct machines *machines, machine__process_t process, void *data) { struct rb_node *nd; for (nd = rb_first_cached(&machines->guests); nd; nd = rb_next(nd)) { struct machine *pos = rb_entry(nd, struct machine, rb_node); process(pos, data); } }
[ 0, 0 ]
Linux Kernel
tools/perf/util/machine.c
static void machine__update_thread_pid(struct machine *machine, struct thread *th, pid_t pid) { struct thread *leader; if (pid == th->pid_ || pid == -1 || th->pid_ != -1) return; th->pid_ = pid; if (th->pid_ == th->tid) return; leader = __machine__findnew_thr...
[ 1, 0 ]
Linux Kernel
tools/perf/util/machine.c
struct thread *__machine__findnew_thread(struct machine *machine, pid_t pid, pid_t tid) { return ____machine__findnew_thread(machine, machine__threads(machine, tid), pid, tid, true); }
[ 0, 0 ]
Linux Kernel
tools/perf/util/machine.c
int machine__process_lost_samples_event(struct machine *machine __maybe_unused, union perf_event *event, struct perf_sample *sample) { dump_printf(": id:%" PRIu64 ": lost samples :%" PRI_lu64 "\n", sample->id, event->lost_s...
[ 0, 0 ]
Linux Kernel
tools/perf/util/machine.c
int machine__process_aux_event(struct machine *machine __maybe_unused, union perf_event *event) { if (dump_trace) perf_event__fprintf_aux(event, stdout); return 0; }
[ 0, 0 ]
Linux Kernel
tools/perf/util/machine.c
int machine__process_itrace_start_event(struct machine *machine __maybe_unused, union perf_event *event) { if (dump_trace) perf_event__fprintf_itrace_start(event, stdout); return 0; }
[ 0, 0 ]
Linux Kernel
tools/perf/util/machine.c
static struct map *machine__addnew_module_map(struct machine *machine, u64 start, const char *filename) { struct map *map = NULL; struct kmod_path m; struct dso *dso; if (kmod_path__parse_name(&m, filename)) return NULL; dso = machine__findnew_module_dso(mac...
[ 0, 0 ]
Linux Kernel
tools/perf/util/machine.c
size_t machines__fprintf_dsos(struct machines *machines, FILE *fp) { struct rb_node *nd; size_t ret = __dsos__fprintf(&machines->host.dsos.head, fp); for (nd = rb_first_cached(&machines->guests); nd; nd = rb_next(nd)) { struct machine *pos = rb_entry(nd, struct machine, rb_node); ret += __dsos__fprintf(...
[ 0, 0 ]
Linux Kernel
tools/perf/util/machine.c
size_t machine__fprintf_vmlinux_path(struct machine *machine, FILE *fp) { int i; size_t printed = 0; struct dso *kdso = machine__kernel_dso(machine); if (kdso->has_build_id) { char filename[PATH_MAX]; if (dso__build_id_filename(kdso, filename, sizeof(filename), false)) printed += fprintf(fp, "[0...
[ 1, 0 ]
Linux Kernel
tools/perf/util/machine.c
size_t machine__fprintf(struct machine *machine, FILE *fp) { struct rb_node *nd; size_t ret; int i; for (i = 0; i < THREADS__TABLE_SIZE; i++) { struct threads *threads = &machine->threads[i]; down_read(&threads->lock); ret = fprintf(fp, "Threads: %u\n", threads->nr); for (nd = rb_first_cach...
[ 0, 0 ]
Linux Kernel
tools/perf/util/machine.c
static struct dso *machine__get_kernel(struct machine *machine) { const char *vmlinux_name = machine->mmap_name; struct dso *kernel; if (machine__is_host(machine)) { if (symbol_conf.vmlinux_name) vmlinux_name = symbol_conf.vmlinux_name; kernel = machine__findnew_kernel(machine, vmlinux_name, "[ke...
[ 1, 0 ]
Linux Kernel
tools/perf/util/machine.c
static u64 find_entry_trampoline(struct dso *dso) { const char *syms[] = { "_entry_trampoline", "__entry_trampoline_start", "entry_SYSCALL_64_trampoline", }; struct symbol *sym = dso__first_symbol(dso); unsigned int i; for (; sym; sym = dso__next_symbol(sym)) { if (sym->binding != STB_...
[ 0, 0 ]
Linux Kernel
tools/perf/util/machine.c
static int __machine__create_kernel_maps(struct machine *machine, struct dso *kernel) { machine__destroy_kernel_maps(machine); machine->vmlinux_map = map__new2(0, kernel); if (machine->vmlinux_map == NULL) return -1; machine->vmlinux_map->map_ip = machine->vmlinux...
[ 1, 0 ]
Linux Kernel
tools/perf/util/machine.c
static int machine__set_modules_path(struct machine *machine) { char *version; char modules_path[PATH_MAX]; version = get_kernel_version(machine->root_dir); if (!version) return -1; snprintf(modules_path, sizeof(modules_path), "%s/lib/modules/%s", machine->root_dir, version); free(version)...
[ 1, 0 ]
Linux Kernel
tools/perf/util/machine.c
int machine__process_exit_event(struct machine *machine, union perf_event *event, struct perf_sample *sample __maybe_unused) { struct thread *thread = machine__find_thread(machine, event->fork.pid, event->fork.tid); if (dump_trace) perf_eve...
[ 0, 0 ]
Linux Kernel
tools/perf/util/machine.c
static bool symbol__match_regex(struct symbol *sym, regex_t *regex) { if (!regexec(regex, sym->name, 0, NULL, 0)) return true; return false; }
[ 0, 0 ]