Projectname
large_stringclasses
15 values
Filepath
large_stringlengths
4
106
⌀
Function
large_stringlengths
11
3.45k
Label
list
Linux Kernel
tools/objtool/elf.c
struct symbol *find_func_containing(struct section *sec, unsigned long offset) { struct rb_node *node; rb_for_each(node, &offset, &sec->symbol_tree, symbol_by_offset) { struct symbol *s = rb_entry(node, struct symbol, node); if (s->type == STT_FUNC) return s; } return NULL; }
[ 0, 0 ]
Linux Kernel
tools/objtool/elf.c
static void elf_add_symbol(struct elf *elf, struct symbol *sym) { struct list_head *entry; struct rb_node *pnode; INIT_LIST_HEAD(&sym->pv_target); sym->alias = sym; sym->type = GELF_ST_TYPE(sym->sym.st_info); sym->bind = GELF_ST_BIND(sym->sym.st_info); if (sym->type == STT_FILE) elf->num_files++; ...
[ 0, 0 ]
Linux Kernel
tools/objtool/elf.c
static int read_rela_reloc(struct section *sec, int i, struct reloc *reloc, unsigned int *symndx) { if (!gelf_getrela(sec->data, i, &reloc->rela)) { WARN_ELF("gelf_getrela"); return -1; } reloc->type = GELF_R_TYPE(reloc->rela.r_info); reloc->addend = reloc->rela.r_addend; r...
[ 0, 0 ]
Linux Kernel
tools/objtool/elf.c
static struct section *elf_create_rel_reloc_section(struct elf *elf, struct section *base) { char *relocname; struct section *sec; relocname = malloc(strlen(base->name) + strlen(".rel") + 1); if (!relocname) { perror("malloc"); return NULL; } str...
[ 1, 0 ]
Linux Kernel
tools/objtool/elf.c
void elf_close(struct elf *elf) { struct section *sec, *tmpsec; struct symbol *sym, *tmpsym; struct reloc *reloc, *tmpreloc; if (elf->elf) elf_end(elf->elf); if (elf->fd > 0) close(elf->fd); list_for_each_entry_safe(sec, tmpsec, &elf->sections, list) { list_for_each_entry_safe(sym, tmpsym, &...
[ 1, 0 ]
Linux Kernel
tools/objtool/include/objtool/check.h
static inline bool is_static_jump(struct instruction *insn) { return insn->type == INSN_JUMP_CONDITIONAL || insn->type == INSN_JUMP_UNCONDITIONAL; }
[ 0, 0 ]
Linux Kernel
tools/objtool/include/objtool/elf.h
static inline u32 sec_offset_hash(struct section *sec, unsigned long offset) { u32 ol, oh, idx = sec->idx; offset &= OFFSET_STRIDE_MASK; ol = offset; oh = (offset >> 16) >> 16; __jhash_mix(ol, oh, idx); return ol; }
[ 0, 0 ]
Linux Kernel
tools/objtool/include/objtool/elf.h
static inline bool has_multiple_files(struct elf *elf) { return elf->num_files > 1; }
[ 0, 0 ]
Linux Kernel
tools/objtool/objtool.c
int main(int argc, const char **argv) { static const char *UNUSED = "OBJTOOL_NOT_IMPLEMENTED"; exec_cmd_init("objtool", UNUSED, UNUSED, UNUSED); pager_init(UNUSED); objtool_run(argc, argv); return 0; }
[ 0, 0 ]
Linux Kernel
tools/objtool/orc_dump.c
static const char *reg_name(unsigned int reg) { switch (reg) { case ORC_REG_PREV_SP: return "prevsp"; case ORC_REG_DX: return "dx"; case ORC_REG_DI: return "di"; case ORC_REG_BP: return "bp"; case ORC_REG_SP: return "sp"; case ORC_REG_R10: return "r10"; case ORC_REG_R13: ret...
[ 0, 0 ]
Linux Kernel
tools/objtool/orc_dump.c
static const char *orc_type_name(unsigned int type) { switch (type) { case UNWIND_HINT_TYPE_CALL: return "call"; case UNWIND_HINT_TYPE_REGS: return "regs"; case UNWIND_HINT_TYPE_REGS_PARTIAL: return "regs (partial)"; default: return "?"; } }
[ 0, 0 ]
Linux Kernel
tools/objtool/orc_gen.c
static int write_orc_entry(struct elf *elf, struct section *orc_sec, struct section *ip_sec, unsigned int idx, struct section *insn_sec, unsigned long insn_off, struct orc_entry *o) { struct orc_entry *orc; orc = (struct orc_entry *)o...
[ 1, 0 ]
Linux Kernel
tools/objtool/special.c
static void reloc_to_sec_off(struct reloc *reloc, struct section **sec, unsigned long *off) { *sec = reloc->sym->sec; *off = reloc->sym->offset + reloc->addend; }
[ 1, 0 ]
Linux Kernel
tools/perf/arch/arc/annotate/instructions.c
static int arc__annotate_init(struct arch *arch, char *cpuid __maybe_unused) { arch->initialized = true; arch->objdump.comment_char = ';'; return 0; }
[ 0, 0 ]
Linux Kernel
tools/perf/arch/arm/tests/dwarf-unwind.c
int test__arch_unwind_sample(struct perf_sample *sample, struct thread *thread) { struct regs_dump *regs = &sample->user_regs; u64 *buf; buf = calloc(1, sizeof(u64) * PERF_REGS_MAX); if (!buf) { pr_debug("failed to allocate sample uregs data\n"); return -1; } perf_reg...
[ 1, 0 ]
Linux Kernel
tools/perf/arch/arm/util/cs-etm.c
static int cs_etm_set_option(struct auxtrace_record *itr, struct evsel *evsel, u32 option) { int i, err = -EINVAL; struct perf_cpu_map *event_cpus = evsel->evlist->core.user_requested_cpus; struct perf_cpu_map *online_cpus = perf_cpu_map__new(NULL); for (i = 0; i < cpu__max_cpu().c...
[ 1, 0 ]
Linux Kernel
tools/perf/arch/arm/util/cs-etm.c
static u64 cs_etm_get_config(struct auxtrace_record *itr) { u64 config = 0; struct cs_etm_recording *ptr = container_of(itr, struct cs_etm_recording, itr); struct perf_pmu *cs_etm_pmu = ptr->cs_etm_pmu; struct evlist *evlist = ptr->evlist; struct evsel *evsel; evlist__for_each_entry(evlist, evsel) { ...
[ 0, 0 ]
Linux Kernel
tools/perf/arch/arm/util/cs-etm.c
static u64 cs_etmv4_get_config(struct auxtrace_record *itr) { u64 config = 0; u64 config_opts = 0; config_opts = cs_etm_get_config(itr); if (config_opts & BIT(ETM_OPT_CYCACC)) config |= BIT(ETM4_CFG_BIT_CYCACC); if (config_opts & BIT(ETM_OPT_CTXTID)) config |= BIT(ETM4_CFG_BIT_CTXTID); if (config_o...
[ 0, 0 ]
Linux Kernel
tools/perf/arch/arm/util/cs-etm.c
static size_t cs_etm_info_priv_size(struct auxtrace_record *itr __maybe_unused, struct evlist *evlist __maybe_unused) { int i; int etmv3 = 0, etmv4 = 0, ete = 0; struct perf_cpu_map *event_cpus = evlist->core.user_requested_cpus; struct perf_cpu_map *online_cpus = perf_cpu_ma...
[ 0, 0 ]
Linux Kernel
tools/perf/arch/arm/util/cs-etm.c
static bool cs_etm_is_ete(struct auxtrace_record *itr, int cpu) { struct cs_etm_recording *ptr = container_of(itr, struct cs_etm_recording, itr); struct perf_pmu *cs_etm_pmu = ptr->cs_etm_pmu; int trcdevarch = cs_etm_get_ro(cs_etm_pmu, cpu, metadata_etmv4_ro[CS_ETE_TRCDEVARCH]); return TRCDEVARCH_A...
[ 1, 0 ]
Linux Kernel
tools/perf/arch/arm/util/unwind-libdw.c
bool libdw__arch_set_initial_registers(Dwfl_Thread *thread, void *arg) { struct unwind_info *ui = arg; struct regs_dump *user_regs = &ui->sample->user_regs; Dwarf_Word dwarf_regs[PERF_REG_ARM_MAX]; #define REG(r) \ ({ ...
[ 0, 0 ]
Linux Kernel
tools/perf/arch/arm64/annotate/instructions.c
static int arm64_mov__parse(struct arch *arch __maybe_unused, struct ins_operands *ops, struct map_symbol *ms __maybe_unused) { char *s = strchr(ops->raw, ','), *target, *endptr; if (s == NULL) return -1; *s = '\0'; ops->source.raw = strdup(ops->raw...
[ 0, 0 ]
Linux Kernel
tools/perf/arch/arm64/annotate/instructions.c
static int arm64__annotate_init(struct arch *arch, char *cpuid __maybe_unused) { struct arm64_annotate *arm; int err; if (arch->initialized) return 0; arm = zalloc(sizeof(*arm)); if (!arm) return ENOMEM; err = regcomp(&arm->call_insn, "^blr?$", REG_EXTENDED); if (err) goto out_free_arm; /...
[ 1, 0 ]
Linux Kernel
tools/perf/arch/arm64/tests/dwarf-unwind.c
static int sample_ustack(struct perf_sample *sample, struct thread *thread, u64 *regs) { struct stack_dump *stack = &sample->user_stack; struct map *map; unsigned long sp; u64 stack_size, *buf; buf = malloc(STACK_SIZE); if (!buf) { pr_debug("failed to allocate sample uregs dat...
[ 1, 0 ]
Linux Kernel
tools/perf/arch/arm64/util/arm-spe.c
static void arm_spe_snapshot_resolve_auxtrace_defaults(struct record_opts *opts, bool privileged) { /* * No size were given to '-S' or '-m,', so go with the default */ if (!opts->auxtrace_snapshot_size && !opts->auxtrace_mmap_pages) { if (privileged)...
[ 1, 0 ]
Linux Kernel
tools/perf/arch/arm64/util/arm-spe.c
static int arm_spe_snapshot_start(struct auxtrace_record *itr) { struct arm_spe_recording *ptr = container_of(itr, struct arm_spe_recording, itr); struct evsel *evsel; evlist__for_each_entry(ptr->evlist, evsel) { if (evsel->core.attr.type == ptr->arm_spe_pmu->type) return evsel__disable(evsel); ...
[ 0, 0 ]
Linux Kernel
tools/perf/arch/arm64/util/arm-spe.c
static bool arm_spe_buffer_has_wrapped(unsigned char *buffer, size_t buffer_size, u64 head) { u64 i, watermark; u64 *buf = (u64 *)buffer; size_t buf_size = buffer_size; if (head >= buffer_size) return true; /* * We want to look the very last 512 byte (chosen arb...
[ 1, 0 ]
Linux Kernel
tools/perf/arch/arm64/util/arm-spe.c
static void arm_spe_recording_free(struct auxtrace_record *itr) { struct arm_spe_recording *sper = container_of(itr, struct arm_spe_recording, itr); free(sper->wrapped); free(sper); }
[ 1, 0 ]
Linux Kernel
tools/perf/arch/arm64/util/hisi-ptt.c
static size_t hisi_ptt_info_priv_size(struct auxtrace_record *itr __maybe_unused, struct evlist *evlist __maybe_unused) { return HISI_PTT_AUXTRACE_PRIV_SIZE; }
[ 0, 0 ]
Linux Kernel
tools/perf/arch/arm64/util/hisi-ptt.c
static int hisi_ptt_info_fill(struct auxtrace_record *itr, struct perf_session *session, struct perf_record_auxtrace_info *auxtrace_info, size_t priv_size) { struct hisi_ptt_recording *pttr = container_of(itr, struct hisi...
[ 1, 0 ]
Linux Kernel
tools/perf/arch/arm64/util/hisi-ptt.c
static int hisi_ptt_set_auxtrace_mmap_page(struct record_opts *opts) { bool privileged = perf_event_paranoid_check(-1); if (!opts->full_auxtrace) return 0; if (opts->full_auxtrace && !opts->auxtrace_mmap_pages) { if (privileged) { opts->auxtrace_mmap_pages = MiB(16) / page_size; } else { ...
[ 1, 0 ]
Linux Kernel
tools/perf/arch/arm64/util/hisi-ptt.c
struct auxtrace_record *hisi_ptt_recording_init(int *err, struct perf_pmu *hisi_ptt_pmu) { struct hisi_ptt_recording *pttr; if (!hisi_ptt_pmu) { *err = -ENODEV; return NULL; } pttr = zalloc(sizeof(*pttr)); if (!pttr) { *err = -ENOMEM; return N...
[ 0, 0 ]
Linux Kernel
tools/perf/arch/arm64/util/kvm-stat.c
static bool event_begin(struct evsel *evsel, struct perf_sample *sample __maybe_unused, struct event_key *key __maybe_unused) { return !strcmp(evsel->name, kvm_entry_trace); }
[ 0, 0 ]
Linux Kernel
tools/perf/arch/arm64/util/machine.c
void arch__add_leaf_frame_record_opts(struct record_opts *opts) { opts->sample_user_regs |= sample_reg_masks[PERF_REG_ARM64_LR].mask; }
[ 0, 0 ]
Linux Kernel
tools/perf/arch/arm64/util/mem-events.c
struct perf_mem_event *perf_mem_events__ptr(int i) { if (i >= PERF_MEM_EVENTS__MAX) return NULL; return &perf_mem_events[i]; }
[ 0, 0 ]
Linux Kernel
tools/perf/arch/arm64/util/pmu.c
const struct pmu_events_table *pmu_events_table__find(void) { struct perf_pmu *pmu = NULL; while ((pmu = perf_pmu__scan(pmu))) { if (!is_pmu_core(pmu->name)) continue; if (pmu->cpus->nr != cpu__max_cpu().cpu) return NULL; return perf_pmu__find_table(pmu); } return NULL; }
[ 1, 0 ]
Linux Kernel
tools/perf/arch/mips/annotate/instructions.c
static struct ins_ops *mips__associate_ins_ops(struct arch *arch, const char *name) { struct ins_ops *ops = NULL; if (!strncmp(name, "bal", 3) || !strncmp(name, "bgezal", 6) || !strncmp(name, "bltzal", 6) || !strncmp(name, "bgtzal", 6) || !strncmp(name, "b...
[ 0, 0 ]
Linux Kernel
tools/perf/arch/mips/util/dwarf-regs.c
const char *get_arch_regstr(unsigned int n) { if (n < 32) return mips_gpr_names[n]; if (n == 64) return "hi"; if (n == 65) return "lo"; return NULL; }
[ 0, 0 ]
Linux Kernel
tools/perf/arch/powerpc/annotate/instructions.c
static struct ins_ops *powerpc__associate_instruction_ops(struct arch *arch, const char *name) { int i; struct ins_ops *ops; if (name[0] != 'b' || !strncmp(name, "bcd", 3) || !strncmp(name, "brinc", 5) || !strncmp(name, "bper", 4)) return NULL; ...
[ 1, 0 ]
Linux Kernel
tools/perf/arch/powerpc/annotate/instructions.c
static int powerpc__annotate_init(struct arch *arch, char *cpuid __maybe_unused) { if (!arch->initialized) { arch->initialized = true; arch->associate_instruction_ops = powerpc__associate_instruction_ops; arch->objdump.comment_char = '#'; } return 0; }
[ 0, 0 ]
Linux Kernel
tools/perf/arch/powerpc/util/event.c
int arch_support_sort_key(const char *sort_key) { if (!strcmp(sort_key, "p_stage_cyc")) return 1; if (!strcmp(sort_key, "local_p_stage_cyc")) return 1; return 0; }
[ 0, 0 ]
Linux Kernel
tools/perf/arch/powerpc/util/header.c
int get_cpuid(char *buffer, size_t sz) { unsigned long pvr; int nb; pvr = mfspr(SPRN_PVR); nb = scnprintf(buffer, sz, "%lu,%lu$", PVR_VER(pvr), PVR_REV(pvr)); if (strchr(buffer, '$')) { buffer[nb - 1] = '\0'; return 0; } return ENOBUFS; }
[ 0, 0 ]
Linux Kernel
tools/perf/arch/powerpc/util/header.c
int arch_get_runtimeparam(const struct pmu_event *pe) { int count; char path[PATH_MAX] = "/devices/hv_24x7/interface/"; atoi(pe->aggr_mode) == PerChip ? strcat(path, "sockets") : strcat(path, "coresperchip"); return sysfs__read_int(path, &count) < 0 ? 1 : count; }
[ 1, 0 ]
Linux Kernel
tools/perf/arch/powerpc/util/kvm-stat.c
static void hcall_event_get_key(struct evsel *evsel, struct perf_sample *sample, struct event_key *key) { key->info = 0; key->key = evsel__intval(evsel, sample, "req"); }
[ 0, 0 ]
Linux Kernel
tools/perf/arch/powerpc/util/kvm-stat.c
static const char *get_hcall_exit_reason(u64 exit_code) { struct exit_reasons_table *tbl = hcall_reasons; while (tbl->reason != NULL) { if (tbl->exit_code == exit_code) return tbl->reason; tbl++; } pr_debug("Unknown hcall code: %lld\n", (unsigned long long)exit_code); return "UNKNOWN"; }
[ 0, 0 ]
Linux Kernel
tools/perf/arch/powerpc/util/kvm-stat.c
static bool hcall_event_end(struct evsel *evsel, struct perf_sample *sample __maybe_unused, struct event_key *key __maybe_unused) { return (!strcmp(evsel->name, kvm_events_tp[3])); }
[ 0, 0 ]
Linux Kernel
tools/perf/arch/powerpc/util/kvm-stat.c
int cpu_isa_init(struct perf_kvm_stat *kvm, const char *cpuid __maybe_unused) { int ret; ret = ppc__setup_kvm_tp(kvm); if (ret) { kvm->exit_reasons = NULL; kvm->exit_reasons_isa = NULL; } return ret; }
[ 0, 0 ]
Linux Kernel
tools/perf/arch/powerpc/util/kvm-stat.c
int kvm_add_default_arch_event(int *argc, const char **argv) { const char **tmp; bool event = false; int i, j = *argc; const struct option event_options[] = { OPT_BOOLEAN('e', "event", &event, NULL), OPT_END()}; tmp = calloc(j + 1, sizeof(char *)); if (!tmp) return -EINVAL; for (i = 0; i < j;...
[ 1, 0 ]
Linux Kernel
tools/perf/arch/powerpc/util/skip-callchain-idx.c
static int check_return_reg(int ra_regno, Dwarf_Frame *frame) { Dwarf_Op ops_mem[3]; Dwarf_Op dummy; Dwarf_Op *ops = &dummy; size_t nops; int result; result = dwarf_frame_register(frame, ra_regno, ops_mem, &ops, &nops); if (result < 0) { pr_debug("dwarf_frame_register() %s\n", dwarf_errmsg(-1)); ...
[ 1, 0 ]
Linux Kernel
tools/perf/arch/powerpc/util/skip-callchain-idx.c
static Dwarf_Frame *get_dwarf_frame(Dwfl_Module *mod, Dwarf_Addr pc) { Dwarf_CFI *cfi; Dwarf_Addr bias; Dwarf_Frame *frame; int result; cfi = dwfl_module_dwarf_cfi(mod, &bias); if (!cfi) { pr_debug("%s(): no CFI - %s\n", __func__, dwfl_errmsg(-1)); return NULL; } result = dwarf_cfi_addrframe(c...
[ 0, 0 ]
Linux Kernel
tools/perf/arch/powerpc/util/sym-handling.c
int arch__choose_best_symbol(struct symbol *syma, struct symbol *symb __maybe_unused) { char *sym = syma->name; #if !defined(_CALL_ELF) || _CALL_ELF != 2 if (*sym == '.') sym++; #endif /* Avoid "SyS" kernel syscall aliases */ if (strlen(sym) >= 3 && !strncmp(sym, "SyS", 3)) ...
[ 1, 0 ]
Linux Kernel
tools/perf/arch/powerpc/util/sym-handling.c
void arch__post_process_probe_trace_events(struct perf_probe_event *pev, int ntevs) { struct probe_trace_event *tev; struct map *map; struct symbol *sym = NULL; struct rb_node *tmp; int i = 0; map = get_target_map(pev->target, pev->nsi, pev->uprobes); if (!map |...
[ 1, 0 ]
Linux Kernel
tools/perf/arch/riscv/util/dwarf-regs.c
int regs_query_register_offset(const char *name) { const struct pt_regs_dwarfnum *roff; for (roff = riscv_dwarf_regs_table; roff->name; roff++) if (!strcmp(roff->name, name)) return roff->dwarfnum; return -EINVAL; }
[ 0, 0 ]
Linux Kernel
tools/perf/arch/riscv/util/unwind-libdw.c
bool libdw__arch_set_initial_registers(Dwfl_Thread *thread, void *arg) { struct unwind_info *ui = arg; struct regs_dump *user_regs = &ui->sample->user_regs; Dwarf_Word dwarf_regs[32]; #define REG(r) \ ({ ...
[ 0, 0 ]
Linux Kernel
tools/perf/arch/riscv64/annotate/instructions.c
static int riscv64__annotate_init(struct arch *arch, char *cpuid __maybe_unused) { if (!arch->initialized) { arch->associate_instruction_ops = riscv64__associate_ins_ops; arch->initialized = true; arch->objdump.comment_char = '#'; } return 0; }
[ 0, 0 ]
Linux Kernel
tools/perf/arch/s390/annotate/instructions.c
static int s390_call__parse(struct arch *arch, struct ins_operands *ops, struct map_symbol *ms) { char *endptr, *tok, *name; struct map *map = ms->map; struct addr_map_symbol target = { .ms = { .map = map, }, }; tok = strchr(ops->raw, ',');...
[ 0, 0 ]
Linux Kernel
tools/perf/arch/s390/annotate/instructions.c
static int s390_mov__parse(struct arch *arch __maybe_unused, struct ins_operands *ops, struct map_symbol *ms __maybe_unused) { char *s = strchr(ops->raw, ','), *target, *endptr; if (s == NULL) return -1; *s = '\0'; ops->source.raw = strdup(ops->raw); ...
[ 0, 0 ]
Linux Kernel
tools/perf/arch/s390/util/auxtrace.c
static size_t cpumsf_info_priv_size(struct auxtrace_record *itr __maybe_unused, struct evlist *evlist __maybe_unused) { return 0; }
[ 0, 0 ]
Linux Kernel
tools/perf/arch/s390/util/dwarf-regs.c
const char *get_arch_regstr(unsigned int n) { return (n >= ARRAY_SIZE(s390_dwarf_regs)) ? NULL : s390_dwarf_regs[n]; }
[ 0, 0 ]
Linux Kernel
tools/perf/arch/s390/util/kvm-stat.c
static void event_diag_get_key(struct evsel *evsel, struct perf_sample *sample, struct event_key *key) { key->key = evsel__intval(evsel, sample, "code"); key->exit_reasons = sie_diagnose_codes; }
[ 0, 0 ]
Linux Kernel
tools/perf/arch/sparc/util/dwarf-regs.c
const char *get_arch_regstr(unsigned int n) { return (n < SPARC_MAX_REGS) ? sparc_regs_table[n] : NULL; }
[ 0, 0 ]
Linux Kernel
tools/perf/arch/x86/tests/bp-modify.c
static int bp_modify1(void) { pid_t child; int status; unsigned long rip = 0, dr7 = 1; child = spawn_child(); waitpid(child, &status, 0); if (WIFEXITED(status)) { pr_debug("tracee exited prematurely 1\n"); return TEST_FAIL; } if (ptrace(PTRACE_POKEUSER, child, offsetof(struct user, u_debugreg...
[ 1, 0 ]
Linux Kernel
tools/perf/arch/x86/tests/bp-modify.c
int test__bp_modify(struct test_suite *test __maybe_unused, int subtest __maybe_unused) { TEST_ASSERT_VAL("modify test 1 failed\n", !bp_modify1()); TEST_ASSERT_VAL("modify test 2 failed\n", !bp_modify2()); return 0; }
[ 0, 0 ]
Linux Kernel
tools/perf/arch/x86/tests/insn-x86.c
static int test_data_item(struct test_data *dat, int x86_64) { struct intel_pt_insn intel_pt_insn; int op, branch, ret; struct insn insn; ret = insn_decode(&insn, dat->data, MAX_INSN_SIZE, x86_64 ? INSN_MODE_64 : INSN_MODE_32); if (ret < 0) { pr_debug("Failed to decode: %s\n", dat->a...
[ 0, 0 ]
Linux Kernel
tools/perf/arch/x86/tests/insn-x86.c
int test__insn_x86(struct test_suite *test __maybe_unused, int subtest __maybe_unused) { int ret = 0; if (test_data_set(test_data_32, 0)) ret = -1; if (test_data_set(test_data_64, 1)) ret = -1; return ret; }
[ 0, 0 ]
Linux Kernel
tools/perf/arch/x86/tests/intel-pt-pkt-decoder-test.c
static int test_ctx_unchanged(struct test_data *d, struct intel_pt_pkt *packet, enum intel_pt_pkt_ctx ctx) { enum intel_pt_pkt_ctx old_ctx = ctx; intel_pt_upd_pkt_ctx(packet, &ctx); if (ctx != old_ctx) { decoding_failed(d); pr_debug("Packet context changed!\n"); return...
[ 0, 0 ]
Linux Kernel
tools/perf/arch/x86/tests/sample-parsing.c
int test__x86_sample_parsing(struct test_suite *test __maybe_unused, int subtest __maybe_unused) { return do_test(PERF_SAMPLE_WEIGHT_STRUCT); }
[ 0, 0 ]
Linux Kernel
tools/perf/arch/x86/util/event.c
int perf_event__synthesize_extra_kmaps(struct perf_tool *tool, perf_event__handler_t process, struct machine *machine) { int rc = 0; struct map *pos; struct maps *kmaps = machine__kernel_maps(machine); union perf_event *event = zalloc...
[ 1, 0 ]
Linux Kernel
tools/perf/arch/x86/util/event.c
void arch_perf_synthesize_sample_weight(const struct perf_sample *data, __u64 *array, u64 type) { *array = data->weight; if (type & PERF_SAMPLE_WEIGHT_STRUCT) { *array &= 0xffffffff; *array |= ((u64)data->ins_lat << 32); } }
[ 1, 0 ]
Linux Kernel
tools/perf/arch/x86/util/evlist.c
int arch_evlist__add_default_attrs(struct evlist *evlist, struct perf_event_attr *attrs, size_t nr_attrs) { if (nr_attrs) return ___evlist__add_default_attrs(evlist, attrs, nr_attrs); return topdown_parse_events(evlist); }
[ 0, 0 ]
Linux Kernel
tools/perf/arch/x86/util/evsel.c
bool arch_evsel__must_be_in_group(const struct evsel *evsel) { if (!evsel__sys_has_perf_metrics(evsel)) return false; return evsel->name && (strcasestr(evsel->name, "slots") || strcasestr(evsel->name, "topdown")); }
[ 0, 0 ]
Linux Kernel
tools/perf/arch/x86/util/evsel.c
void arch__post_evsel_config(struct evsel *evsel, struct perf_event_attr *attr) { struct perf_pmu *evsel_pmu, *ibs_fetch_pmu, *ibs_op_pmu; static int warned_once; static int is_amd; if (warned_once || is_amd == -1) return; if (!is_amd) { struct perf_env *env = evsel__en...
[ 1, 0 ]
Linux Kernel
tools/perf/arch/x86/util/header.c
void get_cpuid_0(char *vendor, unsigned int *lvl) { unsigned int b, c, d; cpuid(0, 0, lvl, &b, &c, &d); strncpy(&vendor[0], (char *)(&b), 4); strncpy(&vendor[4], (char *)(&d), 4); strncpy(&vendor[8], (char *)(&c), 4); vendor[12] = '\0'; }
[ 1, 0 ]
Linux Kernel
tools/perf/arch/x86/util/header.c
int strcmp_cpuid_str(const char *mapcpuid, const char *id) { regex_t re; regmatch_t pmatch[1]; int match; bool full_mapcpuid = is_full_cpuid(mapcpuid); bool full_cpuid = is_full_cpuid(id); if (full_mapcpuid && !full_cpuid) { pr_info("Invalid CPUID %s. Full CPUID is required, " "vendor-famil...
[ 0, 0 ]
Linux Kernel
tools/perf/arch/x86/util/intel-bts.c
static int intel_bts_info_fill(struct auxtrace_record *itr, struct perf_session *session, struct perf_record_auxtrace_info *auxtrace_info, size_t priv_size) { struct intel_bts_recording *btsr = container_of(itr, struct...
[ 1, 0 ]
Linux Kernel
tools/perf/arch/x86/util/intel-bts.c
static int intel_bts_parse_snapshot_options(struct auxtrace_record *itr, struct record_opts *opts, const char *str) { struct intel_bts_recording *btsr = container_of(itr, struct intel_bts_recording, itr); unsigned long lo...
[ 1, 0 ]
Linux Kernel
tools/perf/arch/x86/util/intel-bts.c
static int intel_bts_snapshot_finish(struct auxtrace_record *itr) { struct intel_bts_recording *btsr = container_of(itr, struct intel_bts_recording, itr); struct evsel *evsel; evlist__for_each_entry(btsr->evlist, evsel) { if (evsel->core.attr.type == btsr->intel_bts_pmu->type) return evsel__enab...
[ 0, 0 ]
Linux Kernel
tools/perf/arch/x86/util/intel-bts.c
static bool intel_bts_first_wrap(u64 *data, size_t buf_size) { int i, a, b; b = buf_size >> 3; a = b - 512; if (a < 0) a = 0; for (i = a; i < b; i++) { if (data[i]) return true; } return false; }
[ 0, 0 ]
Linux Kernel
tools/perf/arch/x86/util/intel-pt.c
static const char *intel_pt_find_filter(struct evlist *evlist, struct perf_pmu *intel_pt_pmu) { struct evsel *evsel; evlist__for_each_entry(evlist, evsel) { if (evsel->core.attr.type == intel_pt_pmu->type) return evsel->filter; } return NULL; }
[ 0, 0 ]
Linux Kernel
tools/perf/arch/x86/util/intel-pt.c
static size_t intel_pt_filter_bytes(const char *filter) { size_t len = filter ? strlen(filter) : 0; return len ? roundup(len + 1, 8) : 0; }
[ 0, 0 ]
Linux Kernel
tools/perf/arch/x86/util/intel-pt.c
static size_t intel_pt_info_priv_size(struct auxtrace_record *itr, struct evlist *evlist) { struct intel_pt_recording *ptr = container_of(itr, struct intel_pt_recording, itr); const char *filter = intel_pt_find_filter(evlist, ptr->intel_pt_pmu); ptr->priv_size = (INTEL...
[ 1, 0 ]
Linux Kernel
tools/perf/arch/x86/util/intel-pt.c
static int intel_pt_track_switches(struct evlist *evlist) { const char *sched_switch = "sched:sched_switch"; struct evsel *evsel; int err; if (!evlist__can_select_event(evlist, sched_switch)) return -EPERM; evsel = evlist__add_sched_switch(evlist, true); if (IS_ERR(evsel)) { err = PTR_ERR(evsel);...
[ 0, 0 ]
Linux Kernel
tools/perf/arch/x86/util/intel-pt.c
static void intel_pt_valid_str(char *str, size_t len, u64 valid) { unsigned int val, last = 0, state = 1; int p = 0; str[0] = '\0'; for (val = 0; val <= 64; val++, valid >>= 1) { if (valid & 1) { last = val; switch (state) { case 0: p += scnprintf(str + p, len - p, ","); c...
[ 1, 0 ]
Linux Kernel
tools/perf/arch/x86/util/intel-pt.c
static bool intel_pt_compare_buffers(void *buf1, size_t compare_size, void *buf2, size_t offs2, size_t buf2_size) { size_t end2 = offs2 + compare_size, part_size; if (end2 <= buf2_size) return memcmp(buf1, buf2 + offs2, compare_size); ...
[ 0, 0 ]
Linux Kernel
tools/perf/arch/x86/util/intel-pt.c
static void intel_pt_copy_ref(void *ref_buf, size_t ref_size, size_t buf_size, void *data, size_t head) { if (head >= ref_size) { memcpy(ref_buf, data + head - ref_size, ref_size); } else { memcpy(ref_buf, data, head); ref_size -= head; memcpy(ref_buf + head, data + bu...
[ 1, 0 ]
Linux Kernel
tools/perf/arch/x86/util/intel-pt.c
static bool intel_pt_wrapped(struct intel_pt_recording *ptr, int idx, struct auxtrace_mmap *mm, unsigned char *data, u64 head) { struct intel_pt_snapshot_ref *ref = &ptr->snapshot_refs[idx]; bool wrapped; wrapped = intel_pt_compare_ref(ref->ref_buf...
[ 0, 0 ]
Linux Kernel
tools/perf/arch/x86/util/intel-pt.c
struct auxtrace_record *intel_pt_recording_init(int *err) { struct perf_pmu *intel_pt_pmu = perf_pmu__find(INTEL_PT_PMU_NAME); struct intel_pt_recording *ptr; if (!intel_pt_pmu) return NULL; if (setenv("JITDUMP_USE_ARCH_TIMESTAMP", "1", 1)) { *err = -errno; return NULL; } ptr = zalloc(sizeof(...
[ 0, 0 ]
Linux Kernel
tools/perf/arch/x86/util/iostat.c
static inline int iostat_metrics_count(void) { return sizeof(iostat_metrics) / sizeof(char *); }
[ 1, 0 ]
Linux Kernel
tools/perf/arch/x86/util/iostat.c
static const char *iostat_metric_by_idx(int idx) { return *(iostat_metrics + idx % iostat_metrics_count()); }
[ 0, 0 ]
Linux Kernel
tools/perf/arch/x86/util/iostat.c
static void iio_root_port_show(FILE *output, const struct iio_root_port *const rp) { if (output && rp) fprintf(output, "S%d-uncore_iio_%d<%04x:%02x>\n", rp->die, rp->pmu_idx, rp->domain, rp->bus); }
[ 1, 0 ]
Linux Kernel
tools/perf/arch/x86/util/iostat.c
static int iio_root_ports_list_insert(struct iio_root_ports_list *list, struct iio_root_port *const rp) { struct iio_root_port **tmp_buf; if (list && rp) { rp->idx = list->nr_entries++; tmp_buf = realloc(list->rps, list->nr_entries * sizeof(*list->rps)); if (!tmp_...
[ 1, 0 ]
Linux Kernel
tools/perf/arch/x86/util/iostat.c
int iostat_parse(const struct option *opt, const char *str, int unset __maybe_unused) { int ret; struct perf_stat_config *config = (struct perf_stat_config *)opt->data; ret = iio_root_ports_scan(&root_ports); if (!ret) { config->iostat_run = true; if (!str) iostat_mode = IOSTAT_...
[ 0, 0 ]
Linux Kernel
tools/perf/arch/x86/util/iostat.c
void iostat_release(struct evlist *evlist) { struct evsel *evsel; struct iio_root_port *rp = NULL; evlist__for_each_entry(evlist, evsel) { if (rp != evsel->priv) { rp = evsel->priv; free(evsel->priv); } } }
[ 1, 0 ]
Linux Kernel
tools/perf/arch/x86/util/iostat.c
void iostat_prefix(struct evlist *evlist, struct perf_stat_config *config, char *prefix, struct timespec *ts) { struct iio_root_port *rp = evlist->selected->priv; if (rp) { if (ts) sprintf(prefix, "%6lu.%09lu%s%04x:%02x%s", ts->tv_sec, ts->tv_nsec, config->csv_sep, rp->d...
[ 1, 0 ]
Linux Kernel
tools/perf/arch/x86/util/kvm-stat.c
static void mmio_event_decode_key(struct perf_kvm_stat *kvm __maybe_unused, struct event_key *key, char *decode) { scnprintf(decode, decode_str_len, "%#lx:%s", (unsigned long)key->key, key->info == KVM_TRACE_MMIO_WRITE ? "W" : "R"); }
[ 0, 0 ]
Linux Kernel
tools/perf/arch/x86/util/kvm-stat.c
static bool ioport_event_begin(struct evsel *evsel, struct perf_sample *sample, struct event_key *key) { if (!strcmp(evsel->name, "kvm:kvm_pio")) { ioport_event_get_key(evsel, sample, key); return true; } return false; }
[ 0, 0 ]
Linux Kernel
tools/perf/arch/x86/util/kvm-stat.c
static bool msr_event_begin(struct evsel *evsel, struct perf_sample *sample, struct event_key *key) { if (!strcmp(evsel->name, "kvm:kvm_msr")) { msr_event_get_key(evsel, sample, key); return true; } return false; }
[ 0, 0 ]
Linux Kernel
tools/perf/arch/x86/util/kvm-stat.c
static void msr_event_decode_key(struct perf_kvm_stat *kvm __maybe_unused, struct event_key *key, char *decode) { scnprintf(decode, decode_str_len, "%#llx:%s", (unsigned long long)key->key, key->info ? "W" : "R"); }
[ 0, 0 ]
Linux Kernel
tools/perf/arch/x86/util/machine.c
static int add_extra_kernel_map(struct extra_kernel_map_info *mi, u64 start, u64 end, u64 pgoff, const char *name) { if (mi->cnt >= mi->max_cnt) { void *buf; size_t sz; mi->max_cnt = mi->max_cnt ? mi->max_cnt * 2 : 32; sz = sizeof(struct extra_kernel_map) * mi->max_cn...
[ 1, 0 ]
Linux Kernel
tools/perf/arch/x86/util/mem-events.c
static int perf_mem_is_amd_cpu(void) { struct perf_env env = { .total_mem = 0, }; perf_env__cpuid(&env); if (env.cpuid && strstarts(env.cpuid, "AuthenticAMD")) return 1; return -1; }
[ 0, 0 ]