Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | tools/perf/util/thread.c | static int __thread__set_namespaces(struct thread *thread, u64 timestamp,
struct perf_record_namespaces *event) {
struct namespaces *new, *curr = __thread__namespaces(thread);
new = namespaces__new(event);
if (!new)
return -ENOMEM;
list_add(&new->list, &thread->namespac... | [
0,
0
] |
Linux Kernel | tools/perf/util/thread.c |
struct comm *thread__comm(const struct thread *thread) {
if (list_empty(&thread->comm_list))
return NULL;
return list_first_entry(&thread->comm_list, struct comm, list);
} | [
0,
0
] |
Linux Kernel | tools/perf/util/thread.c |
const char *thread__comm_str(struct thread *thread) {
const char *str;
down_read(&thread->comm_lock);
str = __thread__comm_str(thread);
up_read(&thread->comm_lock);
return str;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/thread.c | int thread__comm_len(struct thread *thread) {
if (!thread->comm_len) {
const char *comm = thread__comm_str(thread);
if (!comm)
return 0;
thread->comm_len = strlen(comm);
}
return thread->comm_len;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/thread.c |
void thread__find_cpumode_addr_location(struct thread *thread, u64 addr,
struct addr_location *al) {
size_t i;
const u8 cpumodes[] = {PERF_RECORD_MISC_USER, PERF_RECORD_MISC_KERNEL,
PERF_RECORD_MISC_GUEST_USER,
PERF_RECORD_MI... | [
0,
0
] |
Linux Kernel | tools/perf/util/thread.c |
struct thread *thread__main_thread(struct machine *machine,
struct thread *thread) {
if (thread->pid_ == thread->tid)
return thread__get(thread);
if (thread->pid_ == -1)
return NULL;
return machine__find_thread(machine, thread->pid_, thread->pid_);
} | [
0,
0
] |
Linux Kernel | tools/perf/util/thread.c |
int thread__memcpy(struct thread *thread, struct machine *machine, void *buf,
u64 ip, int len, bool *is64bit) {
u8 cpumode = PERF_RECORD_MISC_USER;
struct addr_location al;
long offset;
if (machine__kernel_ip(machine, ip))
cpumode = PERF_RECORD_MISC_KERNEL;
if (!thread__find_map(thre... | [
1,
0
] |
Linux Kernel | tools/perf/util/thread.c |
void thread__free_stitch_list(struct thread *thread) {
struct lbr_stitch *lbr_stitch = thread->lbr_stitch;
struct stitch_list *pos, *tmp;
if (!lbr_stitch)
return;
list_for_each_entry_safe(pos, tmp, &lbr_stitch->lists, node) {
list_del_init(&pos->node);
free(pos);
}
list_for_each_entry_safe(p... | [
1,
0
] |
Linux Kernel | tools/perf/util/thread_map.c | static int filter(const struct dirent *dir) {
if (dir->d_name[0] == '.')
return 0;
else
return 1;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/thread_map.c |
struct perf_thread_map *thread_map__new(pid_t pid, pid_t tid, uid_t uid) {
if (pid != -1)
return thread_map__new_by_pid(pid);
if (tid == -1 && uid != UINT_MAX)
return thread_map__new_by_uid(uid);
return thread_map__new_by_tid(tid);
} | [
1,
0
] |
Linux Kernel | tools/perf/util/thread_map.c | static void comm_init(struct perf_thread_map *map, int i) {
pid_t pid = perf_thread_map__pid(map, i);
char *comm = NULL;
if (pid == -1) {
map->map[i].comm = strdup("dummy");
return;
}
/*
* The comm name is like extra bonus ;-),
* so just warn if we fail for any reason.
*/
if (get_comm(&co... | [
0,
0
] |
Linux Kernel | tools/perf/util/time-utils.c |
static int parse_timestr_sec_nsec(struct perf_time_interval *ptime,
char *start_str, char *end_str) {
if (start_str && (*start_str != '\0') &&
(parse_nsec_time(start_str, &ptime->start) != 0)) {
return -1;
}
if (end_str && (*end_str != '\0') &&
(parse_nsec_time(... | [
0,
0
] |
Linux Kernel | tools/perf/util/time-utils.c | static int perf_time__parse_strs(struct perf_time_interval *ptime,
const char *ostr, int size) {
const char *cp;
char *str, *arg, *p;
int i, num = 0, rc = 0;
for (cp = ostr; *cp; cp++)
num += !!(*cp == ',');
if (!num)
return -EINVAL;
BUG_ON(num > size);
str = s... | [
1,
0
] |
Linux Kernel | tools/perf/util/time-utils.c | static int one_percent_convert(struct perf_time_interval *ptime_buf,
const char *ostr, u64 start, u64 end, char *c) {
char *str;
int len = strlen(ostr), ret;
if (ostr + len - 1 != c)
return -1;
/*
* Construct a string like "xx%/1"
*/
str = malloc(len + 3);
if (str ... | [
1,
0
] |
Linux Kernel | tools/perf/util/time-utils.c | bool perf_time__skip_sample(struct perf_time_interval *ptime, u64 timestamp) {
if (timestamp == 0)
return false;
/* otherwise compare sample time to time window */
if ((ptime->start && timestamp < ptime->start) ||
(ptime->end && timestamp > ptime->end)) {
return true;
}
return false;
} | [
1,
0
] |
Linux Kernel | tools/perf/util/time-utils.c | bool perf_time__ranges_skip_sample(struct perf_time_interval *ptime_buf,
int num, u64 timestamp) {
struct perf_time_interval *ptime;
int i;
if ((!ptime_buf) || (timestamp == 0) || (num == 0))
return false;
if (num == 1)
return perf_time__skip_sample(&ptime_buf[0], ti... | [
1,
0
] |
Linux Kernel | tools/perf/util/time-utils.c |
int perf_time__parse_for_ranges_reltime(const char *time_str,
struct perf_session *session,
struct perf_time_interval **ranges,
int *range_size, int *range_num,
... | [
1,
0
] |
Linux Kernel | tools/perf/util/time-utils.c |
int perf_time__parse_for_ranges(const char *time_str,
struct perf_session *session,
struct perf_time_interval **ranges,
int *range_size, int *range_num) {
return perf_time__parse_for_ranges_reltime(time_str, session, rang... | [
0,
0
] |
Linux Kernel | tools/perf/util/time-utils.c |
int fetch_current_timestamp(char *buf, size_t sz) {
struct timeval tv;
struct tm tm;
char dt[32];
if (gettimeofday(&tv, NULL) || !localtime_r(&tv.tv_sec, &tm))
return -1;
if (!strftime(dt, sizeof(dt), "%Y%m%d%H%M%S", &tm))
return -1;
scnprintf(buf, sz, "%s%02u", dt, (unsigned)tv.tv_usec / 10000)... | [
1,
0
] |
Linux Kernel | tools/perf/util/time-utils.h |
static inline unsigned long long rdclock(void) {
struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts);
return ts.tv_sec * 1000000000ULL + ts.tv_nsec;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/top.c |
void perf_top__reset_sample_counters(struct perf_top *top) {
top->samples = top->us_samples = top->kernel_samples = top->exact_samples =
top->guest_kernel_samples = top->guest_us_samples = top->lost =
top->drop = 0;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/topdown.c |
int topdown_filter_events(const char **attr, char **str, bool use_group,
const char *pmu_name) {
int off = 0;
int i;
int len = 0;
char *s;
bool is_hybrid = perf_pmu__is_hybrid(pmu_name);
for (i = 0; attr[i]; i++) {
if (pmu_have_event(pmu_name, attr[i])) {
if (is_hybrid)... | [
1,
0
] |
Linux Kernel | tools/perf/util/trace-event-info.c |
int bigendian(void) {
unsigned char str[] = {0x1, 0x2, 0x3, 0x4, 0x0, 0x0, 0x0, 0x0};
unsigned int *ptr;
ptr = (unsigned int *)(void *)str;
return *ptr == 0x01020304;
} | [
1,
0
] |
Linux Kernel | tools/perf/util/trace-event-info.c |
static bool name_in_tp_list(char *sys, struct tracepoint_path *tps) {
while (tps) {
if (!strcmp(sys, tps->name))
return true;
tps = tps->next;
}
return false;
}
#define for_each_event_tps(dir, dent, tps) \
while ((dent = readdir(dir))) ... | [
1,
0
] |
Linux Kernel | tools/perf/util/trace-event-info.c |
static int record_ftrace_files(struct tracepoint_path *tps) {
char *path;
int ret;
path = get_events_file("ftrace");
if (!path) {
pr_debug("can't get tracing/events/ftrace");
return -ENOMEM;
}
ret = copy_event_system(path, tps);
put_tracing_file(path);
return ret;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/trace-event-info.c |
static void put_tracepoints_path(struct tracepoint_path *tps) {
while (tps) {
struct tracepoint_path *t = tps;
tps = tps->next;
zfree(&t->name);
zfree(&t->system);
free(t);
}
} | [
1,
0
] |
Linux Kernel | tools/perf/util/trace-event-info.c |
static struct tracepoint_path *tracepoint_id_to_path(u64 config) {
struct tracepoint_path *path = NULL;
DIR *sys_dir, *evt_dir;
struct dirent *sys_dirent, *evt_dirent;
char id_buf[24];
int fd;
u64 id;
char evt_path[MAXPATHLEN];
char *dir_path;
sys_dir = tracing_events__opendir();
if (!sys_dir)
... | [
1,
0
] |
Linux Kernel | tools/perf/util/trace-event-info.c | static int tracing_data_header(void) {
char buf[20];
ssize_t size;
buf[0] = 23;
buf[1] = 8;
buf[2] = 68;
memcpy(buf + 3, "tracing", 7);
if (write(output_fd, buf, 10) != 10)
return -1;
size = strlen(VERSION) + 1;
if (write(output_fd, VERSION, size) != size)
return -1;
/* save endian */
... | [
1,
0
] |
Linux Kernel | tools/perf/util/trace-event-info.c | struct tracing_data *tracing_data_get(struct list_head *pattrs, int fd,
bool temp) {
struct tracepoint_path *tps;
struct tracing_data *tdata;
int err;
output_fd = fd;
tps = get_tracepoints_path(pattrs);
if (!tps)
return NULL;
tdata = malloc(sizeof(*tdata));
i... | [
1,
0
] |
Linux Kernel | tools/perf/util/trace-event-info.c |
int tracing_data_put(struct tracing_data *tdata) {
int err = 0;
if (tdata->temp) {
err = record_file(tdata->temp_file, 0);
unlink(tdata->temp_file);
}
free(tdata);
return err;
} | [
1,
0
] |
Linux Kernel | tools/perf/util/trace-event-parse.c |
static int get_common_field(struct scripting_context *context, int *offset,
int *size, const char *type) {
struct tep_handle *pevent = context->pevent;
struct tep_event *event;
struct tep_format_field *field;
if (!*size) {
event = tep_get_first_event(pevent);
if (!event)
... | [
0,
0
] |
Linux Kernel | tools/perf/util/trace-event-parse.c |
unsigned long long read_size(struct tep_event *event, void *ptr, int size) {
return tep_read_number(event->tep, ptr, size);
} | [
0,
0
] |
Linux Kernel | tools/perf/util/trace-event-parse.c |
void event_format__print(struct tep_event *event, int cpu, void *data,
int size) {
return event_format__fprintf(event, cpu, data, size, stdout);
} | [
0,
0
] |
Linux Kernel | tools/perf/util/trace-event-parse.c |
int parse_ftrace_file(struct tep_handle *pevent, char *buf,
unsigned long size) {
return tep_parse_event(pevent, buf, size, "ftrace");
} | [
0,
0
] |
Linux Kernel | tools/perf/util/trace-event-read.c |
static unsigned int read4(struct tep_handle *pevent) {
unsigned int data;
if (do_read(&data, 4) < 0)
return 0;
return tep_read_number(pevent, &data, 4);
} | [
0,
0
] |
Linux Kernel | tools/perf/util/trace-event-read.c |
static char *read_string(void) {
char buf[BUFSIZ];
char *str = NULL;
int size = 0;
off_t r;
char c;
for (;;) {
r = read(input_fd, &c, 1);
if (r < 0) {
pr_debug("reading input file");
goto out;
}
if (!r) {
pr_debug("no data");
goto out;
}
if (repipe) {
... | [
1,
0
] |
Linux Kernel | tools/perf/util/trace-event-read.c | static int read_ftrace_printk(struct tep_handle *pevent) {
unsigned int size;
char *buf;
size = read4(pevent);
if (!size)
return 0;
buf = malloc(size + 1);
if (buf == NULL)
return -1;
if (do_read(buf, size) < 0) {
free(buf);
return -1;
}
buf[size] = '\0';
parse_ftrace_printk(pev... | [
1,
0
] |
Linux Kernel | tools/perf/util/trace-event-read.c |
static int read_event_file(struct tep_handle *pevent, char *sys,
unsigned long long size) {
int ret;
char *buf;
buf = malloc(size);
if (buf == NULL) {
pr_debug("memory allocation failure\n");
return -1;
}
ret = do_read(buf, size);
if (ret < 0)
goto out;
ret = p... | [
1,
0
] |
Linux Kernel | tools/perf/util/trace-event-read.c |
static int read_event_files(struct tep_handle *pevent) {
unsigned long long size;
char *sys;
int systems;
int count;
int i, x;
int ret;
systems = read4(pevent);
for (i = 0; i < systems; i++) {
sys = read_string();
if (sys == NULL)
return -1;
count = read4(pevent);
for (x = 0; ... | [
1,
0
] |
Linux Kernel | tools/perf/util/trace-event-scripting.c |
static void
process_event_unsupported(union perf_event *event __maybe_unused,
struct perf_sample *sample __maybe_unused,
struct evsel *evsel __maybe_unused,
struct addr_location *al __maybe_unused,
struct addr_locat... | [
0,
0
] |
Linux Kernel | tools/perf/util/trace-event-scripting.c |
static int
python_start_script_unsupported(const char *script __maybe_unused,
int argc __maybe_unused,
const char **argv __maybe_unused,
struct perf_session *session __maybe_unused) {
print_python_unsupported_msg();
re... | [
0,
0
] |
Linux Kernel | tools/perf/util/trace-event-scripting.c | void setup_python_scripting(void) {
register_python_scripting(&python_scripting_unsupported_ops);
}
#else | [
0,
0
] |
Linux Kernel | tools/perf/util/trace-event-scripting.c |
static void print_perl_unsupported_msg(void) {
fprintf(stderr, "Perl scripting not supported."
" Install libperl and rebuild perf to enable it.\n"
"For example:\n # apt-get install libperl-dev (ubuntu)"
"\n # yum install 'perl(ExtUtils::Embed)' (Fedora)"
... | [
0,
0
] |
Linux Kernel | tools/perf/util/trace-event-scripting.c |
static int
perl_generate_script_unsupported(struct tep_handle *pevent __maybe_unused,
const char *outfile __maybe_unused) {
print_perl_unsupported_msg();
return -1;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/trace-event.c |
int trace_event__init(struct trace_event *t) {
struct tep_handle *pevent = tep_alloc();
if (pevent) {
t->plugin_list = tep_load_plugins(pevent);
t->pevent = pevent;
}
return pevent ? 0 : -1;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/trace-event.c |
int trace_event__register_resolver(struct machine *machine,
tep_func_resolver_t *func) {
if (!tevent_initialized && trace_event__init2())
return -1;
return tep_set_function_resolver(tevent.pevent, func, machine);
} | [
0,
0
] |
Linux Kernel | tools/perf/util/trace-event.c |
struct tep_event *trace_event__tp_format_id(int id) {
if (!tevent_initialized && trace_event__init2())
return ERR_PTR(-ENOMEM);
return tep_find_event(tevent.pevent, id);
} | [
0,
0
] |
Linux Kernel | tools/perf/util/tracepoint.c | int is_valid_tracepoint(const char *event_string) {
DIR *sys_dir, *evt_dir;
struct dirent *sys_dirent, *evt_dirent;
char evt_path[MAXPATHLEN];
char *dir_path;
sys_dir = tracing_events__opendir();
if (!sys_dir)
return 0;
for_each_subsystem(sys_dir, sys_dirent) {
dir_path = get_events_file(sys_dir... | [
0,
0
] |
Linux Kernel | tools/perf/util/trigger.h |
static inline bool trigger_is_available(struct trigger *t) {
return t->state >= 0;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/units.c |
unsigned long parse_tag_value(const char *str, struct parse_tag *tags) {
struct parse_tag *i = tags;
while (i->tag) {
char *s = strchr(str, i->tag);
if (s) {
unsigned long int value;
char *endptr;
value = strtoul(str, &endptr, 10);
if (s != endptr)
break;
if (value... | [
0,
0
] |
Linux Kernel | tools/perf/util/unwind-libdw.c |
static int __find_debuginfo(Dwfl_Module *mod __maybe_unused, void **userdata,
const char *modname __maybe_unused,
Dwarf_Addr base __maybe_unused,
const char *file_name,
const char *debuglink_file __maybe_unu... | [
0,
0
] |
Linux Kernel | tools/perf/util/unwind-libdw.c | static pid_t next_thread(Dwfl *dwfl, void *arg, void **thread_argp) {
if (*thread_argp != NULL)
return 0;
*thread_argp = arg;
return dwfl_pid(dwfl);
} | [
0,
0
] |
Linux Kernel | tools/perf/util/unwind-libdw.c |
static int access_dso_mem(struct unwind_info *ui, Dwarf_Addr addr,
Dwarf_Word *data) {
struct addr_location al;
ssize_t size;
if (!thread__find_map(ui->thread, PERF_RECORD_MISC_USER, addr, &al)) {
pr_debug("unwind: no map for %lx\n", (unsigned long)addr);
return -1;
}
if (... | [
1,
0
] |
Linux Kernel | tools/perf/util/unwind-libdw.c | int unwind__get_entries(unwind_entry_cb_t cb, void *arg, struct thread *thread,
struct perf_sample *data, int max_stack,
bool best_effort) {
struct unwind_info *ui, ui_buf = {.sample = data,
.thread = thread,
... | [
1,
0
] |
Linux Kernel | tools/perf/util/unwind-libunwind-local.c | static int elf_is_exec(int fd, const char *name) {
Elf *elf;
GElf_Ehdr ehdr;
int retval = 0;
elf = elf_begin(fd, PERF_ELF_C_READ_MMAP, NULL);
if (elf == NULL)
return 0;
if (gelf_getehdr(elf, &ehdr) == NULL)
goto out;
retval = (ehdr.e_type == ET_EXEC);
out:
elf_end(elf);
pr_debug("unwind: el... | [
0,
0
] |
Linux Kernel | tools/perf/util/unwind-libunwind-local.c | static int read_unwind_spec_debug_frame(struct dso *dso,
struct machine *machine, u64 *offset) {
int fd;
u64 ofs = dso->data.debug_frame_offset;
if (ofs == 0) {
fd = dso__data_get_fd(dso, machine);
if (fd >= 0) {
ofs = elf_section_offset(fd, ".debug_frame");
... | [
1,
0
] |
Linux Kernel | tools/perf/util/unwind-libunwind-local.c |
static int access_fpreg(unw_addr_space_t __maybe_unused as,
unw_regnum_t __maybe_unused num,
unw_fpreg_t __maybe_unused *val,
int __maybe_unused __write, void __maybe_unused *arg) {
pr_err("unwind: access_fpreg unsupported\n");
return -UNW_EIN... | [
0,
0
] |
Linux Kernel | tools/perf/util/unwind-libunwind-local.c |
static int resume(unw_addr_space_t __maybe_unused as,
unw_cursor_t __maybe_unused *cu, void __maybe_unused *arg) {
pr_err("unwind: resume unsupported\n");
return -UNW_EINVAL;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/unwind-libunwind-local.c |
static void put_unwind_info(unw_addr_space_t __maybe_unused as,
unw_proc_info_t *pi __maybe_unused,
void *arg __maybe_unused) {
pr_debug("unwind: put_unwind_info called\n");
} | [
0,
0
] |
Linux Kernel | tools/perf/util/unwind-libunwind-local.c |
static void _unwind__flush_access(struct maps *maps) {
unw_flush_cache(maps->addr_space, 0, 0);
} | [
0,
0
] |
Linux Kernel | tools/perf/util/unwind-libunwind-local.c | static int get_entries(struct unwind_info *ui, unwind_entry_cb_t cb, void *arg,
int max_stack) {
u64 val;
unw_word_t ips[max_stack];
unw_addr_space_t addr_space;
unw_cursor_t c;
int ret, i = 0;
ret = perf_reg_value(&val, &ui->sample->user_regs, LIBUNWIND__ARCH_REG_IP);
if (ret)
... | [
1,
0
] |
Linux Kernel | tools/perf/util/unwind.h | static inline int unwind__prepare_access(struct maps *maps __maybe_unused,
struct map *map __maybe_unused,
bool *initialized __maybe_unused) {
return 0;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/unwind.h | static inline int unwind__get_entries(unwind_entry_cb_t cb __maybe_unused,
void *arg __maybe_unused,
struct thread *thread __maybe_unused,
struct perf_sample *data __maybe_unused,
... | [
0,
0
] |
Linux Kernel | tools/perf/util/unwind.h |
static inline void unwind__flush_access(struct maps *maps __maybe_unused) {} | [
0,
0
] |
Linux Kernel | tools/perf/util/util.c |
int sysctl__max_stack(void) {
int value;
if (sysctl__read_int("kernel/perf_event_max_stack", &value) == 0)
sysctl_perf_event_max_stack = value;
if (sysctl__read_int("kernel/perf_event_max_contexts_per_stack", &value) == 0)
sysctl_perf_event_max_contexts_per_stack = value;
return sysctl_perf_event_ma... | [
0,
0
] |
Linux Kernel | tools/perf/util/util.c |
bool sysctl__nmi_watchdog_enabled(void) {
static bool cached;
static bool nmi_watchdog;
int value;
if (cached)
return nmi_watchdog;
if (sysctl__read_int("kernel/nmi_watchdog", &value) < 0)
return false;
nmi_watchdog = (value > 0) ? true : false;
cached = true;
return nmi_watchdog;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/util.c | void event_attr_init(struct perf_event_attr *attr) {
if (!perf_host)
attr->exclude_host = 1;
if (!perf_guest)
attr->exclude_guest = 1;
attr->size = sizeof(*attr);
} | [
1,
0
] |
Linux Kernel | tools/perf/util/util.c |
int rm_rf(const char *path) { return rm_rf_depth_pat(path, INT_MAX, NULL); } | [
0,
0
] |
Linux Kernel | tools/perf/util/util.c | bool lsdir_no_dot_filter(const char *name __maybe_unused, struct dirent *d) {
return d->d_name[0] != '.';
} | [
0,
0
] |
Linux Kernel | tools/perf/util/util.c |
size_t hex_width(u64 v) {
size_t n = 1;
while ((v >>= 4))
++n;
return n;
} | [
1,
0
] |
Linux Kernel | tools/perf/util/util.c |
char *perf_exe(char *buf, int len) {
int n = readlink("/proc/self/exe", buf, len);
if (n > 0) {
buf[n] = 0;
return buf;
}
return strcpy(buf, "perf");
} | [
1,
0
] |
Linux Kernel | tools/perf/util/util.c | int do_realloc_array_as_needed(void **arr, size_t *arr_sz, size_t x, size_t msz,
const void *init_val) {
size_t new_sz = *arr_sz;
void *new_arr;
size_t i;
if (!new_sz)
new_sz = msz >= 64 ? 1 : roundup(64, msz);
while (x >= new_sz) {
if (check_mul_overflow(new_sz, (size_... | [
1,
0
] |
Linux Kernel | tools/perf/util/values.c |
int perf_read_values_init(struct perf_read_values *values) {
values->threads_max = 16;
values->pid = malloc(values->threads_max * sizeof(*values->pid));
values->tid = malloc(values->threads_max * sizeof(*values->tid));
values->value = zalloc(values->threads_max * sizeof(*values->value));
if (!values->pid || ... | [
1,
0
] |
Linux Kernel | tools/perf/util/values.c |
static int perf_read_values__findnew_thread(struct perf_read_values *values,
u32 pid, u32 tid) {
int i;
for (i = 0; i < values->threads; i++)
if (values->pid[i] == pid && values->tid[i] == tid)
return i;
if (values->threads == values->threads_max) {
i =... | [
1,
0
] |
Linux Kernel | tools/perf/util/values.c |
static int perf_read_values__findnew_counter(struct perf_read_values *values,
u64 rawid, const char *name) {
int i;
for (i = 0; i < values->counters; i++)
if (values->counterrawid[i] == rawid)
return i;
if (values->counters == values->counters_max) {
i... | [
0,
0
] |
Linux Kernel | tools/perf/util/vdso.c |
static struct vdso_info *vdso_info__new(void) {
static const struct vdso_info vdso_info_init = {
.vdso =
{
.temp_file_name = VDSO__TEMP_FILE_NAME,
.dso_name = DSO__NAME_VDSO,
},
#if BITS_PER_LONG == 64
.vdso32 =
{
.temp_file_name = V... | [
1,
0
] |
Linux Kernel | tools/perf/util/vdso.c |
static struct dso *__machine__findnew_compat(struct machine *machine,
struct vdso_file *vdso_file) {
const char *file_name;
struct dso *dso;
dso = __dsos__find(&machine->dsos, vdso_file->dso_name, true);
if (dso)
goto out;
file_name = vdso__get_compat_file(v... | [
0,
0
] |
Linux Kernel | tools/perf/util/vdso.c |
static struct dso *machine__find_vdso(struct machine *machine,
struct thread *thread) {
struct dso *dso = NULL;
enum dso_type dso_type;
dso_type = machine__thread_dso_type(machine, thread);
switch (dso_type) {
case DSO__TYPE_32BIT:
dso = __dsos__find(&machine->dsos,... | [
1,
0
] |
Linux Kernel | tools/perf/util/zlib.c | int gzip_decompress_to_file(const char *input, int output_fd) {
int ret = Z_STREAM_ERROR;
int input_fd;
void *ptr;
int len;
struct stat stbuf;
unsigned char buf[CHUNK_SIZE];
z_stream zs = {
.zalloc = Z_NULL,
.zfree = Z_NULL,
.opaque = Z_NULL,
.avail_in = 0,
.next_in = Z_NULL,... | [
0,
0
] |
Linux Kernel | tools/power/acpi/os_specific/service_layers/oslinuxtbl.c | static acpi_physical_address
osl_find_rsdp_via_efi_by_keyword(FILE *file, const char *keyword) {
char buffer[80];
unsigned long long address = 0;
char format[32];
snprintf(format, 32, "%s=%s", keyword, "%llx");
fseek(file, 0, SEEK_SET);
while (fgets(buffer, 80, file)) {
if (sscanf(buffer, format, &addr... | [
1,
0
] |
Linux Kernel | tools/power/acpi/os_specific/service_layers/oslinuxtbl.c | static u8 osl_can_use_xsdt(void) {
if (gbl_revision && !acpi_gbl_do_not_use_xsdt) {
return (TRUE);
} else {
return (FALSE);
}
} | [
0,
0
] |
Linux Kernel | tools/power/acpi/os_specific/service_layers/oslinuxtbl.c | static acpi_status osl_list_bios_tables(void) {
struct acpi_table_header *mapped_table = NULL;
u8 *table_data;
u8 number_of_tables;
u8 item_size;
acpi_physical_address table_address = 0;
acpi_status status = AE_OK;
u32 i;
if (osl_can_use_xsdt()) {
item_size = sizeof(u64);
table_data = ACPI_CAST... | [
1,
0
] |
Linux Kernel | tools/power/acpi/os_specific/service_layers/osunixmap.c | static acpi_size acpi_os_get_page_size(void) {
#ifdef PAGE_SIZE
return PAGE_SIZE;
#else
return sysconf(_SC_PAGESIZE);
#endif
} | [
0,
0
] |
Linux Kernel | tools/power/acpi/os_specific/service_layers/osunixmap.c | void *acpi_os_map_memory(acpi_physical_address where, acpi_size length) {
u8 *mapped_memory;
acpi_physical_address offset;
acpi_size page_size;
int fd;
fd = open(SYSTEM_MEMORY, O_RDONLY | O_BINARY);
if (fd < 0) {
fprintf(stderr, "Cannot open %s\n", SYSTEM_MEMORY);
return (NULL);
}
page_size = ... | [
0,
0
] |
Linux Kernel | tools/power/acpi/os_specific/service_layers/osunixxf.c | acpi_status acpi_os_get_line(char *buffer, u32 buffer_length, u32 *bytes_read) {
int input_char;
u32 end_of_line;
for (end_of_line = 0;; end_of_line++) {
if (end_of_line >= buffer_length) {
return (AE_BUFFER_OVERFLOW);
}
if ((input_char = getchar()) == EOF) {
return (AE_ERROR);
}
... | [
1,
0
] |
Linux Kernel | tools/power/acpi/os_specific/service_layers/osunixxf.c | void acpi_os_unmap_memory(void *where, acpi_size length) { return; } | [
0,
0
] |
Linux Kernel | tools/power/acpi/os_specific/service_layers/osunixxf.c | void *acpi_os_allocate(acpi_size size) {
void *mem;
mem = (void *)malloc((size_t)size);
return (mem);
} | [
0,
0
] |
Linux Kernel | tools/power/acpi/os_specific/service_layers/osunixxf.c | void acpi_os_free(void *mem) { free(mem); } | [
1,
0
] |
Linux Kernel | tools/power/acpi/os_specific/service_layers/osunixxf.c |
acpi_status acpi_os_delete_semaphore(acpi_handle handle) { return (AE_OK); } | [
0,
0
] |
Linux Kernel | tools/power/acpi/os_specific/service_layers/osunixxf.c | acpi_status acpi_os_create_semaphore(u32 max_units, u32 initial_units,
acpi_handle *out_handle) {
sem_t *sem;
if (!out_handle) {
return (AE_BAD_PARAMETER);
}
#ifdef __APPLE__
{
static int semaphore_count = 0;
char semaphore_name[32];
snprintf(semaphore_name... | [
1,
0
] |
Linux Kernel | tools/power/acpi/os_specific/service_layers/osunixxf.c | acpi_status acpi_os_signal_semaphore(acpi_handle handle, u32 units) {
sem_t *sem = (sem_t *)handle;
if (!sem) {
return (AE_BAD_PARAMETER);
}
if (sem_post(sem) == -1) {
return (AE_LIMIT);
}
return (AE_OK);
} | [
0,
0
] |
Linux Kernel | tools/power/acpi/os_specific/service_layers/osunixxf.c |
acpi_cpu_flags acpi_os_acquire_lock(acpi_handle handle) {
acpi_os_wait_semaphore(handle, 1, 0xFFFF);
return (0);
} | [
0,
0
] |
Linux Kernel | tools/power/acpi/os_specific/service_layers/osunixxf.c | u64 acpi_os_get_timer(void) {
struct timeval time;
gettimeofday(&time, NULL);
/* (Seconds * 10^7 = 100ns(10^-7)) + (Microseconds(10^-6) * 10^1 = 100ns) */
return (((u64)time.tv_sec * ACPI_100NSEC_PER_SEC) +
((u64)time.tv_usec * ACPI_100NSEC_PER_USEC));
} | [
0,
0
] |
Linux Kernel | tools/power/acpi/os_specific/service_layers/osunixxf.c | acpi_status acpi_os_read_pci_configuration(struct acpi_pci_id *pci_id,
u32 pci_register, u64 *value,
u32 width) {
*value = 0;
return (AE_OK);
} | [
0,
0
] |
Linux Kernel | tools/power/acpi/os_specific/service_layers/osunixxf.c | acpi_status acpi_os_read_memory(acpi_physical_address address, u64 *value,
u32 width) {
switch (width) {
case 8:
case 16:
case 32:
case 64:
*value = 0;
break;
default:
return (AE_BAD_PARAMETER);
}
return (AE_OK);
} | [
0,
0
] |
Linux Kernel | tools/power/acpi/os_specific/service_layers/osunixxf.c | acpi_status acpi_os_execute(acpi_execute_type type,
acpi_osd_exec_callback function, void *context) {
pthread_t thread;
int ret;
ret = pthread_create(&thread, NULL, (PTHREAD_CALLBACK)function, context);
if (ret) {
acpi_os_printf("Create thread failed");
}
return (0);
}
#els... | [
0,
0
] |
Linux Kernel | tools/power/acpi/os_specific/service_layers/osunixxf.c | acpi_status acpi_os_execute(acpi_execute_type type,
acpi_osd_exec_callback function, void *context) {
function(context);
return (AE_OK);
}
#endif | [
0,
0
] |
Linux Kernel | tools/power/acpi/tools/acpidump/apdump.c | int ap_dump_table_by_name(char *signature) {
char local_signature[ACPI_NAMESEG_SIZE + 1];
u32 instance;
struct acpi_table_header *table;
acpi_physical_address address;
acpi_status status;
int table_status;
if (strlen(signature) != ACPI_NAMESEG_SIZE) {
fprintf(stderr,
"Invalid table signat... | [
1,
0
] |
Linux Kernel | tools/power/acpi/tools/acpidump/apfiles.c | static int ap_is_existing_file(char *pathname) {
#if !defined(_GNU_EFI) && !defined(_EDK2_EFI)
struct stat stat_info;
int in_char;
if (!stat(pathname, &stat_info)) {
fprintf(stderr, "Target path already exists, overwrite? [y|n] ");
in_char = fgetc(stdin);
if (in_char == '\n') {
in_char = fgetc... | [
0,
0
] |
Linux Kernel | tools/power/acpi/tools/acpidump/apfiles.c | int ap_write_to_binary_file(struct acpi_table_header *table, u32 instance) {
char filename[ACPI_NAMESEG_SIZE + 16];
char instance_str[16];
ACPI_FILE file;
acpi_size actual;
u32 table_length;
table_length = ap_get_table_length(table);
/* Construct lower-case filename from the table local signature */
... | [
1,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.