Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | tools/perf/util/svghelper.c |
static void scan_core_topology(int *map, struct topology *t, int nr_cpus) {
int pos = 0;
int i;
int cpu;
for (i = 0; i < t->sib_core_nr; i++)
for_each_set_bit(cpu, cpumask_bits(&t->sib_core[i]), nr_cpus)
scan_thread_topology(map, t, cpu, &pos, nr_cpus);
} | [
0,
0
] |
Linux Kernel | tools/perf/util/svghelper.c |
static int str_to_bitmap(char *s, cpumask_t *b, int nr_cpus) {
int i;
int ret = 0;
struct perf_cpu_map *m;
struct perf_cpu c;
m = perf_cpu_map__new(s);
if (!m)
return -1;
for (i = 0; i < perf_cpu_map__nr(m); i++) {
c = perf_cpu_map__cpu(m, i);
if (c.cpu >= nr_cpus) {
ret = -1;
b... | [
0,
0
] |
Linux Kernel | tools/perf/util/svghelper.c |
int svg_build_topology_map(struct perf_env *env) {
int i, nr_cpus;
struct topology t;
char *sib_core, *sib_thr;
nr_cpus = min(env->nr_cpus_online, MAX_NR_CPUS);
t.sib_core_nr = env->nr_sibling_cores;
t.sib_thr_nr = env->nr_sibling_threads;
t.sib_core = calloc(env->nr_sibling_cores, sizeof(cpumask_t));
... | [
1,
0
] |
Linux Kernel | tools/perf/util/symbol-elf.c |
static inline char *bfd_demangle(void __maybe_unused *v, const char *c, int i) {
return cplus_demangle(c, i);
} | [
0,
0
] |
Linux Kernel | tools/perf/util/symbol-elf.c | static int elf_getshdrstrndx(Elf *elf __maybe_unused,
size_t *dst __maybe_unused) {
pr_err("%s: update your libelf to > 0.140, this one lacks "
"elf_getshdrstrndx().\n",
__func__);
return -1;
}
#endif
#ifndef NT_GNU_BUILD_ID
#define NT_GNU_BUILD_ID 3
#endif
#define e... | [
1,
0
] |
Linux Kernel | tools/perf/util/symbol-elf.c |
static inline bool elf_sym__is_object(const GElf_Sym *sym) {
return elf_sym__type(sym) == STT_OBJECT && sym->st_name != 0 &&
sym->st_shndx != SHN_UNDEF;
} | [
1,
0
] |
Linux Kernel | tools/perf/util/symbol-elf.c |
static inline int elf_sym__is_label(const GElf_Sym *sym) {
return elf_sym__type(sym) == STT_NOTYPE && sym->st_name != 0 &&
sym->st_shndx != SHN_UNDEF && sym->st_shndx != SHN_ABS &&
elf_sym__visibility(sym) != STV_HIDDEN &&
elf_sym__visibility(sym) != STV_INTERNAL;
} | [
1,
0
] |
Linux Kernel | tools/perf/util/symbol-elf.c |
static bool elf_sym__filter(GElf_Sym *sym) {
return elf_sym__is_function(sym) || elf_sym__is_object(sym);
} | [
0,
0
] |
Linux Kernel | tools/perf/util/symbol-elf.c |
static bool elf_sec__filter(GElf_Shdr *shdr, Elf_Data *secstrs) {
return elf_sec__is_text(shdr, secstrs) || elf_sec__is_data(shdr, secstrs);
} | [
0,
0
] |
Linux Kernel | tools/perf/util/symbol-elf.c |
static size_t elf_addr_to_index(Elf *elf, GElf_Addr addr) {
Elf_Scn *sec = NULL;
GElf_Shdr shdr;
size_t cnt = 1;
while ((sec = elf_nextscn(elf, sec)) != NULL) {
gelf_getshdr(sec, &shdr);
if ((addr >= shdr.sh_addr) && (addr < (shdr.sh_addr + shdr.sh_size)))
return cnt;
++cnt;
}
return ... | [
0,
0
] |
Linux Kernel | tools/perf/util/symbol-elf.c | static char *demangle_sym(struct dso *dso, int kmodule, const char *elf_name) {
int demangle_flags = verbose > 0 ? (DMGL_PARAMS | DMGL_ANSI) : DMGL_NO_OPTS;
char *demangled = NULL;
if (!want_demangle(dso->kernel || kmodule))
return demangled;
demangled = bfd_demangle(NULL, elf_name, demangle_flags);
if ... | [
0,
0
] |
Linux Kernel | tools/perf/util/symbol-elf.c |
static int read_build_id(const char *filename, struct build_id *bid) {
size_t size = sizeof(bid->data);
int fd, err = -1;
Elf *elf;
if (size < BUILD_ID_SIZE)
goto out;
fd = open(filename, O_RDONLY);
if (fd < 0)
goto out;
elf = elf_begin(fd, PERF_ELF_C_READ_MMAP, NULL);
if (elf == NULL) {
... | [
1,
0
] |
Linux Kernel | tools/perf/util/symbol-elf.c |
bool symsrc__possibly_runtime(struct symsrc *ss) {
return ss->dynsym || ss->opdsec;
} | [
1,
0
] |
Linux Kernel | tools/perf/util/symbol-elf.c | bool elf__needs_adjust_symbols(GElf_Ehdr ehdr) {
return ehdr.e_type == ET_EXEC || ehdr.e_type == ET_REL ||
ehdr.e_type == ET_DYN;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/symbol-elf.c | int dso__load_sym(struct dso *dso, struct map *map, struct symsrc *syms_ss,
struct symsrc *runtime_ss, int kmodule) {
int nr = 0;
int err = -1;
dso->symtab_type = syms_ss->type;
dso->is_64_bit = syms_ss->is_64_bit;
dso->rel = syms_ss->ehdr.e_type == ET_REL;
if (kmodule && syms_ss->symtab... | [
1,
0
] |
Linux Kernel | tools/perf/util/symbol-elf.c | static int copy_bytes(int from, off_t from_offs, int to, off_t to_offs,
u64 len) {
ssize_t r;
size_t n;
int err = -1;
char *buf = malloc(page_size);
if (buf == NULL)
return -1;
if (lseek(to, to_offs, SEEK_SET) != to_offs)
goto out;
if (lseek(from, from_offs, SEEK_SET) != f... | [
1,
0
] |
Linux Kernel | tools/perf/util/symbol-elf.c |
static int kcore__open(struct kcore *kcore, const char *filename) {
GElf_Ehdr *ehdr;
kcore->fd = open(filename, O_RDONLY);
if (kcore->fd == -1)
return -1;
kcore->elf = elf_begin(kcore->fd, ELF_C_READ, NULL);
if (!kcore->elf)
goto out_close;
kcore->elfclass = gelf_getclass(kcore->elf);
if (kcor... | [
0,
0
] |
Linux Kernel | tools/perf/util/symbol-elf.c |
static int kcore__copy_hdr(struct kcore *from, struct kcore *to, size_t count) {
GElf_Ehdr *ehdr = &to->ehdr;
GElf_Ehdr *kehdr = &from->ehdr;
memcpy(ehdr->e_ident, kehdr->e_ident, EI_NIDENT);
ehdr->e_type = kehdr->e_type;
ehdr->e_machine = kehdr->e_machine;
ehdr->e_version = kehdr->e_version;
ehdr->e_en... | [
1,
0
] |
Linux Kernel | tools/perf/util/symbol-elf.c |
static struct phdr_data *phdr_data__new(u64 addr, u64 len, off_t offset) {
struct phdr_data *p = zalloc(sizeof(*p));
if (p) {
p->addr = addr;
p->len = len;
p->offset = offset;
}
return p;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/symbol-elf.c |
static void kcore_copy__free_syms(struct kcore_copy_info *kci) {
struct sym_data *s, *tmp;
list_for_each_entry_safe(s, tmp, &kci->syms, node) {
list_del_init(&s->node);
free(s);
}
} | [
1,
0
] |
Linux Kernel | tools/perf/util/symbol-elf.c |
static int kcore_copy__process_modules(void *arg,
const char *name __maybe_unused,
u64 start, u64 size __maybe_unused) {
struct kcore_copy_info *kci = arg;
if (!kci->first_module || start < kci->first_module)
kci->first_module = sta... | [
1,
0
] |
Linux Kernel | tools/perf/util/symbol-elf.c |
static int kcore_copy__parse_modules(struct kcore_copy_info *kci,
const char *dir) {
char modules_filename[PATH_MAX];
scnprintf(modules_filename, PATH_MAX, "%s/modules", dir);
if (symbol__restricted_filename(modules_filename, "/proc/modules"))
return -1;
if (modules_... | [
0,
0
] |
Linux Kernel | tools/perf/util/symbol-elf.c |
static int kcore_copy__map(struct kcore_copy_info *kci, u64 start, u64 end,
u64 pgoff, u64 s, u64 e) {
u64 len, offset;
if (s < start || s >= end)
return 0;
offset = (s - start) + pgoff;
len = e < end ? e - s : end - s;
return kcore_copy_info__addnew(kci, s, len, offset) ? 0... | [
1,
0
] |
Linux Kernel | tools/perf/util/symbol-elf.c |
static int kcore_copy__unlink(const char *dir, const char *name) {
char filename[PATH_MAX];
scnprintf(filename, PATH_MAX, "%s/%s", dir, name);
return unlink(filename);
} | [
0,
0
] |
Linux Kernel | tools/perf/util/symbol-elf.c | static int kcore_copy__compare_fds(int from, int to) {
char *buf_from;
char *buf_to;
ssize_t ret;
size_t len;
int err = -1;
buf_from = malloc(page_size);
buf_to = malloc(page_size);
if (!buf_from || !buf_to)
goto out;
while (1) {
ret = read(from, buf_from, page_size);
if (ret < 0)
... | [
1,
0
] |
Linux Kernel | tools/perf/util/symbol-elf.c |
static int kcore_copy__compare_files(const char *from_filename,
const char *to_filename) {
int from, to, err = -1;
from = open(from_filename, O_RDONLY);
if (from < 0)
return -1;
to = open(to_filename, O_RDONLY);
if (to < 0)
goto out_close_from;
err = kcore_co... | [
0,
0
] |
Linux Kernel | tools/perf/util/symbol-elf.c |
static void sdt_adjust_refctr(struct sdt_note *tmp, GElf_Addr base_addr,
GElf_Addr base_off) {
if (!base_off)
return;
if (tmp->bit32 && tmp->addr.a32[SDT_NOTE_IDX_REFCTR])
tmp->addr.a32[SDT_NOTE_IDX_REFCTR] -= (base_addr - base_off);
else if (tmp->addr.a64[SDT_NOTE_IDX_REFC... | [
1,
0
] |
Linux Kernel | tools/perf/util/symbol-elf.c | static int construct_sdt_notes_list(Elf *elf, struct list_head *sdt_notes) {
GElf_Ehdr ehdr;
Elf_Scn *scn = NULL;
Elf_Data *data;
GElf_Shdr shdr;
size_t shstrndx, next;
GElf_Nhdr nhdr;
size_t name_off, desc_off, offset;
int ret = 0;
if (gelf_getehdr(elf, &ehdr) == NULL) {
ret = -EBADF;
goto o... | [
1,
0
] |
Linux Kernel | tools/perf/util/symbol-elf.c | int get_sdt_note_list(struct list_head *head, const char *target) {
Elf *elf;
int fd, ret;
fd = open(target, O_RDONLY);
if (fd < 0)
return -EBADF;
elf = elf_begin(fd, PERF_ELF_C_READ_MMAP, NULL);
if (!elf) {
ret = -EBADF;
goto out_close;
}
ret = construct_sdt_notes_list(elf, head);
elf_e... | [
0,
0
] |
Linux Kernel | tools/perf/util/symbol-elf.c | int cleanup_sdt_note_list(struct list_head *sdt_notes) {
struct sdt_note *tmp, *pos;
int nr_free = 0;
list_for_each_entry_safe(pos, tmp, sdt_notes, note_list) {
list_del_init(&pos->note_list);
zfree(&pos->args);
zfree(&pos->name);
zfree(&pos->provider);
free(pos);
nr_free++;
}
return ... | [
1,
0
] |
Linux Kernel | tools/perf/util/symbol-elf.c | int sdt_notes__get_count(struct list_head *start) {
struct sdt_note *sdt_ptr;
int count = 0;
list_for_each_entry(sdt_ptr, start, note_list) count++;
return count;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/symbol-minimal.c |
static bool check_need_swap(int file_endian) {
const int data = 1;
u8 *check = (u8 *)&data;
int host_endian;
if (check[0] == 1)
host_endian = ELFDATA2LSB;
else
host_endian = ELFDATA2MSB;
return host_endian != file_endian;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/symbol-minimal.c |
int file__read_maps(int fd __maybe_unused, bool exe __maybe_unused,
mapfn_t mapfn __maybe_unused, void *data __maybe_unused,
bool *is_64_bit __maybe_unused) {
return -1;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/symbol-minimal.c |
int kcore_copy(const char *from_dir __maybe_unused,
const char *to_dir __maybe_unused) {
return -1;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/symbol-minimal.c |
void symbol__elf_init(void) {} | [
0,
0
] |
Linux Kernel | tools/perf/util/symbol.c |
static bool symbol_type__filter(char symbol_type) {
symbol_type = toupper(symbol_type);
return symbol_type == 'T' || symbol_type == 'W' || symbol_type == 'D' ||
symbol_type == 'B';
} | [
1,
0
] |
Linux Kernel | tools/perf/util/symbol.c | void symbols__fixup_end(struct rb_root_cached *symbols, bool is_kallsyms) {
struct rb_node *nd, *prevnd = rb_first_cached(symbols);
struct symbol *curr, *prev;
if (prevnd == NULL)
return;
curr = rb_entry(prevnd, struct symbol, rb_node);
for (nd = rb_next(prevnd); nd; nd = rb_next(nd)) {
prev = curr... | [
1,
0
] |
Linux Kernel | tools/perf/util/symbol.c | void maps__fixup_end(struct maps *maps) {
struct map *prev = NULL, *curr;
down_write(&maps->lock);
maps__for_each_entry(maps, curr) {
if (prev != NULL && !prev->end)
prev->end = curr->start;
prev = curr;
}
if (curr && !curr->end)
curr->end = ~0ULL;
up_write(&maps->lock);
} | [
1,
0
] |
Linux Kernel | tools/perf/util/symbol.c |
struct symbol *symbol__new(u64 start, u64 len, u8 binding, u8 type,
const char *name) {
size_t namelen = strlen(name) + 1;
struct symbol *sym =
calloc(1, (symbol_conf.priv_size + sizeof(*sym) + namelen));
if (sym == NULL)
return NULL;
if (symbol_conf.priv_size) {
if (s... | [
1,
0
] |
Linux Kernel | tools/perf/util/symbol.c |
void symbol__delete(struct symbol *sym) {
if (symbol_conf.priv_size) {
if (symbol_conf.init_annotation) {
struct annotation *notes = symbol__annotation(sym);
annotation__exit(notes);
}
}
free(((void *)sym) - symbol_conf.priv_size);
} | [
1,
0
] |
Linux Kernel | tools/perf/util/symbol.c |
void symbols__insert(struct rb_root_cached *symbols, struct symbol *sym) {
__symbols__insert(symbols, sym, false);
} | [
0,
0
] |
Linux Kernel | tools/perf/util/symbol.c |
static void symbols__insert_by_name(struct rb_root_cached *symbols,
struct symbol *sym) {
struct rb_node **p = &symbols->rb_root.rb_node;
struct rb_node *parent = NULL;
struct symbol_name_rb_node *symn, *s;
bool leftmost = true;
symn = container_of(sym, struct symbol_name... | [
1,
0
] |
Linux Kernel | tools/perf/util/symbol.c |
int symbol__match_symbol_name(const char *name, const char *str,
enum symbol_tag_include includes) {
const char *versioning;
if (includes == SYMBOL_TAG_INCLUDE__DEFAULT_ONLY &&
(versioning = strstr(name, "@@"))) {
int len = strlen(str);
if (len < versioning - name)
... | [
0,
0
] |
Linux Kernel | tools/perf/util/symbol.c |
struct symbol *dso__find_symbol(struct dso *dso, u64 addr) {
if (dso->last_find_result.addr != addr ||
dso->last_find_result.symbol == NULL) {
dso->last_find_result.addr = addr;
dso->last_find_result.symbol = symbols__find(&dso->symbols, addr);
}
return dso->last_find_result.symbol;
} | [
1,
0
] |
Linux Kernel | tools/perf/util/symbol.c |
struct symbol *dso__next_symbol(struct symbol *sym) {
return symbols__next(sym);
} | [
0,
0
] |
Linux Kernel | tools/perf/util/symbol.c | *Returns first symbol that matched with @name.* /
struct symbol *dso__find_symbol_by_name(struct dso *dso, const char *name) {
struct symbol *s =
symbols__find_by_name(&dso->symbol_names, name, SYMBOL_TAG_INCLUDE__NONE);
if (!s)
s = symbols__find_by_name(&dso->symbol_names, name,
... | [
0,
0
] |
Linux Kernel | tools/perf/util/symbol.c | static int map__process_kallsym_symbol(void *arg, const char *name, char type,
u64 start) {
struct symbol *sym;
struct dso *dso = arg;
struct rb_root_cached *root = &dso->symbols;
if (!symbol_type__filter(type))
return 0;
if (name[0] == '$')
return 0;
/*
... | [
0,
0
] |
Linux Kernel | tools/perf/util/symbol.c |
bool symbol__restricted_filename(const char *filename,
const char *restricted_filename) {
bool restricted = false;
if (symbol_conf.kptr_restrict) {
char *r = realpath(filename, NULL);
if (r != NULL) {
restricted = strcmp(r, restricted_filename) == 0;
free(r);
... | [
1,
0
] |
Linux Kernel | tools/perf/util/symbol.c |
static void add_module(struct module_info *mi, struct rb_root *modules) {
struct rb_node **p = &modules->rb_node;
struct rb_node *parent = NULL;
struct module_info *m;
while (*p != NULL) {
parent = *p;
m = rb_entry(parent, struct module_info, rb_node);
if (strcmp(mi->name, m->name) < 0)
p = ... | [
1,
0
] |
Linux Kernel | tools/perf/util/symbol.c |
int compare_proc_modules(const char *from, const char *to) {
struct rb_root from_modules = RB_ROOT;
struct rb_root to_modules = RB_ROOT;
struct rb_node *from_node, *to_node;
struct module_info *from_m, *to_m;
int ret = -1;
if (read_proc_modules(from, &from_modules))
return -1;
if (read_proc_modules... | [
1,
0
] |
Linux Kernel | tools/perf/util/symbol.c |
static int kcore_mapfn(u64 start, u64 len, u64 pgoff, void *data) {
struct kcore_mapfn_data *md = data;
struct map *map;
map = map__new2(start, md->dso);
if (map == NULL)
return -ENOMEM;
map->end = map->start + len;
map->pgoff = pgoff;
list_add(&map->node, &md->maps);
return 0;
} | [
1,
0
] |
Linux Kernel | tools/perf/util/symbol.c |
int __dso__load_kallsyms(struct dso *dso, const char *filename, struct map *map,
bool no_kcore) {
struct kmap *kmap = map__kmap(map);
u64 delta = 0;
if (symbol__restricted_filename(filename, "/proc/kallsyms"))
return -1;
if (!kmap || !kmap->kmaps)
return -1;
if (dso__load_... | [
0,
0
] |
Linux Kernel | tools/perf/util/symbol.c | static bool dso__is_compatible_symtab_type(struct dso *dso, bool kmod,
enum dso_binary_type type) {
switch (type) {
case DSO_BINARY_TYPE__JAVA_JIT:
case DSO_BINARY_TYPE__DEBUGLINK:
case DSO_BINARY_TYPE__SYSTEM_PATH_DSO:
case DSO_BINARY_TYPE__FEDORA_DEBUGINFO:
case ... | [
1,
0
] |
Linux Kernel | tools/perf/util/symbol.c | static int dso__find_perf_map(char *filebuf, size_t bufsz,
struct nsinfo **nsip) {
struct nscookie nsc;
struct nsinfo *nsi;
struct nsinfo *nnsi;
int rc = -1;
nsi = *nsip;
if (nsinfo__need_setns(nsi)) {
snprintf(filebuf, bufsz, "/tmp/perf-%d.map", nsinfo__nstgid(nsi));
... | [
1,
0
] |
Linux Kernel | tools/perf/util/symbol.c |
static int map__strcmp(const void *a, const void *b) {
const struct map *ma = *(const struct map **)a, *mb = *(const struct map **)b;
return strcmp(ma->dso->short_name, mb->dso->short_name);
} | [
1,
0
] |
Linux Kernel | tools/perf/util/symbol.c |
static int map__strcmp_name(const void *name, const void *b) {
const struct map *map = *(const struct map **)b;
return strcmp(name, map->dso->short_name);
} | [
0,
0
] |
Linux Kernel | tools/perf/util/symbol.c |
void __maps__sort_by_name(struct maps *maps) {
qsort(maps->maps_by_name, maps->nr_maps, sizeof(struct map *), map__strcmp);
} | [
1,
0
] |
Linux Kernel | tools/perf/util/symbol.c | struct map *maps__find_by_name(struct maps *maps, const char *name) {
struct map *map;
down_read(&maps->lock);
if (maps->last_search_by_name &&
strcmp(maps->last_search_by_name->dso->short_name, name) == 0) {
map = maps->last_search_by_name;
goto out_unlock;
}
map = __maps__find_by_name(maps,... | [
1,
0
] |
Linux Kernel | tools/perf/util/symbol.c | static bool filename__readable(const char *file) {
int fd = open(file, O_RDONLY);
if (fd < 0)
return false;
close(fd);
return true;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/symbol.c | static char *dso__find_kallsyms(struct dso *dso, struct map *map) {
struct build_id bid;
char sbuild_id[SBUILD_ID_SIZE];
bool is_host = false;
char path[PATH_MAX];
if (!dso->has_build_id) {
goto proc_kallsyms;
}
if (sysfs__read_build_id("/sys/kernel/notes", &bid) == 0)
is_host = dso__build_id_e... | [
1,
0
] |
Linux Kernel | tools/perf/util/symbol.c | static int dso__load_guest_kernel_sym(struct dso *dso, struct map *map) {
int err;
const char *kallsyms_filename;
struct machine *machine = map__kmaps(map)->machine;
char path[PATH_MAX];
if (machine->kallsyms_filename) {
kallsyms_filename = machine->kallsyms_filename;
} else if (machine__is_default_gue... | [
1,
0
] |
Linux Kernel | tools/perf/util/symbol.c |
static int vmlinux_path__add(const char *new_entry) {
vmlinux_path[vmlinux_path__nr_entries] = strdup(new_entry);
if (vmlinux_path[vmlinux_path__nr_entries] == NULL)
return -1;
++vmlinux_path__nr_entries;
return 0;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/symbol.c | static int vmlinux_path__init(struct perf_env *env) {
struct utsname uts;
char bf[PATH_MAX];
char *kernel_version;
unsigned int i;
vmlinux_path = malloc(sizeof(char *) * (ARRAY_SIZE(vmlinux_paths) +
ARRAY_SIZE(vmlinux_paths_upd)));
if (vmlinux_path == NULL)
ret... | [
1,
0
] |
Linux Kernel | tools/perf/util/symbol.c |
int setup_list(struct strlist **list, const char *list_str,
const char *list_name) {
if (list_str == NULL)
return 0;
*list = strlist__new(list_str, NULL);
if (!*list) {
pr_err("problems parsing %s list\n", list_name);
return -1;
}
symbol_conf.has_filter = true;
return 0;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/symbol.h |
static inline size_t symbol__size(const struct symbol *sym) {
return sym->end - sym->start;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/symbol_fprintf.c |
size_t symbol__fprintf(struct symbol *sym, FILE *fp) {
return fprintf(fp, " %" PRIx64 "-%" PRIx64 " %c %s\n", sym->start, sym->end,
sym->binding == STB_GLOBAL ? 'g'
: sym->binding == STB_LOCAL ? 'l'
: 'w',
sym->name);
} | [
1,
0
] |
Linux Kernel | tools/perf/util/symbol_fprintf.c |
size_t __symbol__fprintf_symname_offs(const struct symbol *sym,
const struct addr_location *al,
bool unknown_as_addr, bool print_offsets,
FILE *fp) {
unsigned long offset;
size_t length;
if (sym) {
... | [
1,
0
] |
Linux Kernel | tools/perf/util/symbol_fprintf.c |
size_t symbol__fprintf_symname_offs(const struct symbol *sym,
const struct addr_location *al, FILE *fp) {
return __symbol__fprintf_symname_offs(sym, al, false, true, fp);
} | [
0,
0
] |
Linux Kernel | tools/perf/util/synthetic-events.c | static int perf_event__synthesize_fork(struct perf_tool *tool,
union perf_event *event, pid_t pid,
pid_t tgid, pid_t ppid,
perf_event__handler_t process,
struct mac... | [
1,
0
] |
Linux Kernel | tools/perf/util/synthetic-events.c | static int perf_event__walk_cgroup_tree(struct perf_tool *tool,
union perf_event *event, char *path,
size_t mount_len,
perf_event__handler_t process,
struct mac... | [
1,
0
] |
Linux Kernel | tools/perf/util/synthetic-events.c |
int perf_event__synthesize_kernel_mmap(struct perf_tool *tool,
perf_event__handler_t process,
struct machine *machine) {
int err;
err = __perf_event__synthesize_kernel_mmap(tool, process, machine);
if (err < 0)
return err;
retu... | [
0,
0
] |
Linux Kernel | tools/perf/util/synthetic-events.c |
int perf_event__synthesize_thread_map2(struct perf_tool *tool,
struct perf_thread_map *threads,
perf_event__handler_t process,
struct machine *machine) {
union perf_event *event;
int i, err, size;
... | [
1,
0
] |
Linux Kernel | tools/perf/util/synthetic-events.c | static void *cpu_map_data__alloc(struct synthesize_cpu_map_data *syn_data,
size_t header_size) {
size_t size_cpus, size_mask;
syn_data->nr = perf_cpu_map__nr(syn_data->map);
syn_data->has_any_cpu =
(perf_cpu_map__cpu(syn_data->map, 0).cpu == -1) ? 1 : 0;
syn_data->min_cp... | [
1,
0
] |
Linux Kernel | tools/perf/util/synthetic-events.c |
static void cpu_map_data__synthesize(struct synthesize_cpu_map_data *data) {
switch (data->type) {
case PERF_CPU_MAP__CPUS:
synthesize_cpus(data);
break;
case PERF_CPU_MAP__MASK:
synthesize_mask(data);
break;
case PERF_CPU_MAP__RANGE_CPUS:
synthesize_range_cpus(data);
break;
default:
... | [
0,
0
] |
Linux Kernel | tools/perf/util/synthetic-events.c |
int perf_event__synthesize_stat_config(struct perf_tool *tool,
struct perf_stat_config *config,
perf_event__handler_t process,
struct machine *machine) {
struct perf_record_stat_config *event;
int s... | [
1,
0
] |
Linux Kernel | tools/perf/util/synthetic-events.c |
int perf_event__synthesize_stat(struct perf_tool *tool, struct perf_cpu cpu,
u32 thread, u64 id,
struct perf_counts_values *count,
perf_event__handler_t process,
struct machine *machine) {
... | [
1,
0
] |
Linux Kernel | tools/perf/util/synthetic-events.c | int __machine__synthesize_threads(struct machine *machine,
struct perf_tool *tool, struct target *target,
struct perf_thread_map *threads,
perf_event__handler_t process,
bool needs_mma... | [
0,
0
] |
Linux Kernel | tools/perf/util/synthetic-events.c |
int machine__synthesize_threads(struct machine *machine, struct target *target,
struct perf_thread_map *threads,
bool needs_mmap, bool data_mmap,
unsigned int nr_threads_synthesize) {
return __machine__synthesize_threads(... | [
0,
0
] |
Linux Kernel | tools/perf/util/synthetic-events.c |
static struct perf_record_event_update *
event_update_event__new(size_t size, u64 type, u64 id) {
struct perf_record_event_update *ev;
size += sizeof(*ev);
size = PERF_ALIGN(size, sizeof(u64));
ev = zalloc(size);
if (ev) {
ev->header.type = PERF_RECORD_EVENT_UPDATE;
ev->header.size = (u16)size;
... | [
1,
0
] |
Linux Kernel | tools/perf/util/synthetic-events.c |
static bool has_unit(struct evsel *evsel) {
return evsel->unit && *evsel->unit;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/synthetic-events.c |
int perf_event__synthesize_build_id(struct perf_tool *tool, struct dso *pos,
u16 misc, perf_event__handler_t process,
struct machine *machine) {
union perf_event ev;
size_t len;
if (!pos->hit)
return 0;
memset(&ev, 0, sizeof(ev));
... | [
1,
0
] |
Linux Kernel | tools/perf/util/synthetic-events.c |
int perf_event__synthesize_stat_events(struct perf_stat_config *config,
struct perf_tool *tool,
struct evlist *evlist,
perf_event__handler_t process,
bool attrs) {... | [
0,
0
] |
Linux Kernel | tools/perf/util/synthetic-events.c | int perf_event__synthesize_features(struct perf_tool *tool,
struct perf_session *session,
struct evlist *evlist,
perf_event__handler_t process) {
struct perf_header *header = &session->header;
struct perf_rec... | [
1,
0
] |
Linux Kernel | tools/perf/util/syscalltbl.c |
struct syscalltbl *syscalltbl__new(void) {
struct syscalltbl *tbl = malloc(sizeof(*tbl));
if (tbl) {
if (syscalltbl__init_native(tbl)) {
free(tbl);
return NULL;
}
}
return tbl;
} | [
1,
0
] |
Linux Kernel | tools/perf/util/syscalltbl.c |
const char *syscalltbl__name(const struct syscalltbl *tbl __maybe_unused,
int id) {
return id <= syscalltbl_native_max_id ? syscalltbl_native[id] : NULL;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/target.c | int target__strerror(struct target *target, int errnum, char *buf,
size_t buflen) {
int idx;
const char *msg;
BUG_ON(buflen == 0);
if (errnum >= 0) {
str_error_r(errnum, buf, buflen);
return 0;
}
if (errnum < __TARGET_ERRNO__START || errnum >= __TARGET_ERRNO__END)
return ... | [
1,
0
] |
Linux Kernel | tools/perf/util/target.h |
static inline bool target__has_task(struct target *target) {
return target->tid || target->pid || target->uid_str;
} | [
1,
0
] |
Linux Kernel | tools/perf/util/target.h |
static inline bool target__uses_dummy_map(struct target *target) {
bool use_dummy = false;
if (target->default_per_cpu)
use_dummy = target->per_thread ? true : false;
else if (target__has_task(target) ||
(!target__has_cpu(target) && !target->uses_mmap))
use_dummy = true;
else if (target__ha... | [
0,
0
] |
Linux Kernel | tools/perf/util/term.c |
void get_term_dimensions(struct winsize *ws) {
char *s = getenv("LINES");
if (s != NULL) {
ws->ws_row = atoi(s);
s = getenv("COLUMNS");
if (s != NULL) {
ws->ws_col = atoi(s);
if (ws->ws_row && ws->ws_col)
return;
}
}
#ifdef TIOCGWINSZ
if (ioctl(1, TIOCGWINSZ, ws) == 0 && ws... | [
1,
0
] |
Linux Kernel | tools/perf/util/thread-stack.c |
static struct thread_stack *thread_stack__new(struct thread *thread, int cpu,
struct call_return_processor *crp,
bool callstack,
unsigned int br_stack_sz) {
struct thread_stack *t... | [
1,
0
] |
Linux Kernel | tools/perf/util/thread-stack.c |
static struct thread_stack *thread__cpu_stack(struct thread *thread, int cpu) {
struct thread_stack *ts = thread->ts;
if (cpu < 0)
cpu = 0;
if (!ts || (unsigned int)cpu >= ts->arr_sz)
return NULL;
ts += cpu;
if (!ts->stack)
return NULL;
return ts;
} | [
1,
0
] |
Linux Kernel | tools/perf/util/thread-stack.c | static void thread_stack__update_br_stack(struct thread_stack *ts, u32 flags,
u64 from_ip, u64 to_ip) {
struct branch_stack *bs = ts->br_stack_rb;
struct branch_entry *be;
if (!ts->br_stack_pos)
ts->br_stack_pos = ts->br_stack_sz;
ts->br_stack_pos -= 1;
be = &b... | [
0,
0
] |
Linux Kernel | tools/perf/util/thread-stack.c |
void thread_stack__free(struct thread *thread) {
struct thread_stack *ts = thread->ts;
unsigned int pos;
if (ts) {
for (pos = 0; pos < ts->arr_sz; pos++)
__thread_stack__free(thread, ts + pos);
zfree(&thread->ts);
}
} | [
0,
0
] |
Linux Kernel | tools/perf/util/thread-stack.c |
void thread_stack__sample(struct thread *thread, int cpu,
struct ip_callchain *chain, size_t sz, u64 ip,
u64 kernel_start) {
struct thread_stack *ts = thread__stack(thread, cpu);
u64 context = callchain_context(ip, kernel_start);
u64 last_context;
size_t i, j... | [
1,
0
] |
Linux Kernel | tools/perf/util/thread-stack.c |
void thread_stack__br_sample(struct thread *thread, int cpu,
struct branch_stack *dst, unsigned int sz) {
struct thread_stack *ts = thread__stack(thread, cpu);
const size_t bsz = sizeof(struct branch_entry);
struct branch_stack *src;
struct branch_entry *be;
unsigned int nr;
d... | [
1,
0
] |
Linux Kernel | tools/perf/util/thread-stack.c |
static int thread_stack__pop_cp(struct thread *thread, struct thread_stack *ts,
u64 ret_addr, u64 timestamp, u64 ref,
struct symbol *sym) {
int err;
if (!ts->cnt)
return 1;
if (ts->cnt == 1) {
struct thread_stack_entry *tse = &ts->stack[0]... | [
1,
0
] |
Linux Kernel | tools/perf/util/thread-stack.c | static int thread_stack__trace_end(struct thread_stack *ts,
struct perf_sample *sample, u64 ref) {
struct call_path_root *cpr = ts->crp->cpr;
struct call_path *cp;
u64 ret_addr;
if (!ts->cnt || (ts->cnt == 1 && ts->stack[0].ref == ref))
return 0;
cp = call_path__findne... | [
1,
0
] |
Linux Kernel | tools/perf/util/thread-stack.c |
size_t thread_stack__depth(struct thread *thread, int cpu) {
struct thread_stack *ts = thread__stack(thread, cpu);
if (!ts)
return 0;
return ts->cnt;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/thread.c | struct thread *thread__new(pid_t pid, pid_t tid) {
char *comm_str;
struct comm *comm;
struct thread *thread = zalloc(sizeof(*thread));
if (thread != NULL) {
thread->pid_ = pid;
thread->tid = tid;
thread->ppid = -1;
thread->cpu = -1;
thread->guest_cpu = -1;
thread->lbr_stitch_enable = fa... | [
1,
0
] |
Linux Kernel | tools/perf/util/thread.c |
void thread__delete(struct thread *thread) {
struct namespaces *namespaces, *tmp_namespaces;
struct comm *comm, *tmp_comm;
BUG_ON(!RB_EMPTY_NODE(&thread->rb_node));
thread_stack__free(thread);
if (thread->maps) {
maps__put(thread->maps);
thread->maps = NULL;
}
down_write(&thread->namespaces_lo... | [
1,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.