Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | tools/perf/builtin-daemon.c |
static int cmd_session_kill(struct daemon *daemon, union cmd *cmd, FILE *out) {
struct daemon_session *session;
bool all = false;
all = !strcmp(cmd->signal.name, "all");
list_for_each_entry(session, &daemon->sessions, list) {
if (all || !strcmp(cmd->signal.name, session->name)) {
daemon_session__si... | [
1,
0
] |
Linux Kernel | tools/perf/builtin-daemon.c |
static int cmd_session_ping(struct daemon *daemon, union cmd *cmd, FILE *out) {
struct daemon_session *session;
bool all = false, found = false;
all = !strcmp(cmd->ping.name, "all");
list_for_each_entry(session, &daemon->sessions, list) {
if (all || !strcmp(cmd->ping.name, session->name)) {
int sta... | [
1,
0
] |
Linux Kernel | tools/perf/builtin-daemon.c | static int check_lock(struct daemon *daemon) {
char path[PATH_MAX];
char buf[20];
int fd, pid;
ssize_t len;
scnprintf(path, sizeof(path), "%s/lock", daemon->base);
fd = open(path, O_RDWR | O_CREAT | O_CLOEXEC, 0640);
if (fd < 0)
return -1;
if (lockf(fd, F_TLOCK, 0) < 0) {
filename__read_int(p... | [
1,
0
] |
Linux Kernel | tools/perf/builtin-daemon.c | static int send_cmd(struct daemon *daemon, union cmd *cmd) {
int ret = -1, fd;
char *line = NULL;
size_t len = 0;
ssize_t nread;
FILE *in = NULL;
if (setup_client_config(daemon))
return -1;
fd = setup_client_socket(daemon);
if (fd < 0)
return -1;
if (sizeof(*cmd) != writen(fd, cmd, sizeof(*... | [
1,
0
] |
Linux Kernel | tools/perf/builtin-daemon.c |
static int __cmd_stop(struct daemon *daemon, struct option parent_options[],
int argc, const char **argv) {
struct option start_options[] = {OPT_PARENT(parent_options), OPT_END()};
union cmd cmd;
argc = parse_options(argc, argv, start_options, daemon_usage, 0);
if (argc)
usage_with_o... | [
1,
0
] |
Linux Kernel | tools/perf/builtin-daemon.c |
int cmd_daemon(int argc, const char **argv) {
struct option daemon_options[] = {
OPT_INCR('v', "verbose", &verbose, "be more verbose"),
OPT_STRING(0, "config", &__daemon.config, "config file",
"config file path"),
OPT_STRING(0, "base", &__daemon.base_user, "directory", "base direct... | [
1,
0
] |
Linux Kernel | tools/perf/builtin-data.c |
int cmd_data(int argc, const char **argv) {
struct data_cmd *cmd;
const char *cmdstr;
argc = parse_options_subcommand(argc, argv, data_options, data_subcommands,
data_usage, PARSE_OPT_STOP_AT_NON_OPTION);
if (!argc) {
usage_with_options(data_usage, data_options);
ret... | [
0,
0
] |
Linux Kernel | tools/perf/builtin-diff.c |
static int setup_compute_opt_wdiff(char *opt) {
char *w1_str = opt;
char *w2_str;
int ret = -EINVAL;
if (!opt)
goto out;
w2_str = strchr(opt, ',');
if (!w2_str)
goto out;
*w2_str++ = 0x0;
if (!*w2_str)
goto out;
compute_wdiff_w1 = strtol(w1_str, NULL, 10);
compute_wdiff_w2 = strtol... | [
1,
0
] |
Linux Kernel | tools/perf/builtin-diff.c |
static int setup_compute_opt(char *opt) {
if (compute == COMPUTE_WEIGHTED_DIFF)
return setup_compute_opt_wdiff(opt);
if (opt) {
pr_err("Failed: extra option specified '%s'", opt);
return -EINVAL;
}
return 0;
} | [
0,
0
] |
Linux Kernel | tools/perf/builtin-diff.c |
static double period_percent(struct hist_entry *he, u64 period) {
u64 total = hists__total_period(he->hists);
return (period * 100.0) / total;
} | [
0,
0
] |
Linux Kernel | tools/perf/builtin-diff.c |
static s64 compute_wdiff(struct hist_entry *he, struct hist_entry *pair) {
u64 old_period = he->stat.period;
u64 new_period = pair->stat.period;
pair->diff.computed = true;
pair->diff.wdiff =
new_period * compute_wdiff_w2 - old_period * compute_wdiff_w1;
return pair->diff.wdiff;
} | [
0,
0
] |
Linux Kernel | tools/perf/builtin-diff.c |
static int formula_delta(struct hist_entry *he, struct hist_entry *pair,
char *buf, size_t size) {
u64 he_total = he->hists->stats.total_period;
u64 pair_total = pair->hists->stats.total_period;
if (symbol_conf.filter_relative) {
he_total = he->hists->stats.total_non_filtered_period... | [
0,
0
] |
Linux Kernel | tools/perf/builtin-diff.c |
static struct hist_entry *get_pair_data(struct hist_entry *he,
struct data__file *d) {
if (hist_entry__has_pairs(he)) {
struct hist_entry *pair;
list_for_each_entry(pair, &he->pairs.head,
pairs.node) if (pair->hists == d->hists) return pair;
... | [
0,
0
] |
Linux Kernel | tools/perf/builtin-diff.c |
static void compute_cycles_diff(struct hist_entry *he,
struct hist_entry *pair) {
pair->diff.computed = true;
if (pair->block_info->num && he->block_info->num) {
pair->diff.cycles =
pair->block_info->cycles_aggr / pair->block_info->num_aggr -
he->block_info->cycl... | [
1,
0
] |
Linux Kernel | tools/perf/builtin-diff.c |
static void block_hists_match(struct hists *hists_base,
struct hists *hists_pair) {
struct rb_root_cached *root = hists_base->entries_in;
struct rb_node *next = rb_first_cached(root);
while (next != NULL) {
struct hist_entry *he = rb_entry(next, struct hist_entry, rb_node_in);
... | [
0,
0
] |
Linux Kernel | tools/perf/builtin-diff.c |
static int64_t __hist_entry__cmp_compute(struct hist_entry *left,
struct hist_entry *right, int c) {
switch (c) {
case COMPUTE_DELTA: {
double l = left->diff.period_ratio_delta;
double r = right->diff.period_ratio_delta;
return cmp_doubles(l, r);
}
case COM... | [
0,
0
] |
Linux Kernel | tools/perf/builtin-diff.c | static int64_t hist_entry__cmp_compute(struct hist_entry *left,
struct hist_entry *right, int c,
int sort_idx) {
bool pairs_left = hist_entry__has_pairs(left);
bool pairs_right = hist_entry__has_pairs(right);
struct hist_entry *p_right,... | [
0,
0
] |
Linux Kernel | tools/perf/builtin-diff.c |
static int64_t hist_entry__cmp_delta(struct perf_hpp_fmt *fmt,
struct hist_entry *left,
struct hist_entry *right) {
struct data__file *d = fmt_to_data_file(fmt);
return hist_entry__cmp_compute(right, left, COMPUTE_DELTA, d->idx);
} | [
0,
0
] |
Linux Kernel | tools/perf/builtin-diff.c |
static int64_t hist_entry__cmp_delta_abs(struct perf_hpp_fmt *fmt,
struct hist_entry *left,
struct hist_entry *right) {
struct data__file *d = fmt_to_data_file(fmt);
return hist_entry__cmp_compute(right, left, COMPUTE_DELTA_ABS, d->... | [
0,
0
] |
Linux Kernel | tools/perf/builtin-diff.c |
static int64_t hist_entry__cmp_ratio(struct perf_hpp_fmt *fmt,
struct hist_entry *left,
struct hist_entry *right) {
struct data__file *d = fmt_to_data_file(fmt);
return hist_entry__cmp_compute(right, left, COMPUTE_RATIO, d->idx);
} | [
0,
0
] |
Linux Kernel | tools/perf/builtin-diff.c |
static int64_t hist_entry__cmp_wdiff(struct perf_hpp_fmt *fmt,
struct hist_entry *left,
struct hist_entry *right) {
struct data__file *d = fmt_to_data_file(fmt);
return hist_entry__cmp_compute(right, left, COMPUTE_WEIGHTED_DIFF, d->idx);
} | [
0,
0
] |
Linux Kernel | tools/perf/builtin-diff.c |
static int64_t
hist_entry__cmp_delta_idx(struct perf_hpp_fmt *fmt __maybe_unused,
struct hist_entry *left, struct hist_entry *right) {
return hist_entry__cmp_compute_idx(right, left, COMPUTE_DELTA, sort_compute);
} | [
0,
0
] |
Linux Kernel | tools/perf/builtin-diff.c |
static void data__fprintf(void) {
struct data__file *d;
int i;
fprintf(stdout, "# Data files:\n");
data__for_each_file(i, d) fprintf(stdout, "# [%d] %s %s\n", d->idx,
d->data.path, !d->idx ? "(Baseline)" : "");
fprintf(stdout, "#\n");
} | [
0,
0
] |
Linux Kernel | tools/perf/builtin-diff.c |
static int process_base_stream(struct data__file *data_base,
struct data__file *data_pair,
const char *title __maybe_unused) {
struct evlist *evlist_base = data_base->session->evlist;
struct evlist *evlist_pair = data_pair->session->evlist;
struct evs... | [
1,
0
] |
Linux Kernel | tools/perf/builtin-diff.c | static int parse_absolute_time(struct data__file *d, char **pstr) {
char *p = *pstr;
int ret;
p = strchr(*pstr, ':');
if (p) {
if (p == *pstr) {
pr_err("Invalid time string\n");
return -EINVAL;
}
*p = 0;
p++;
if (*p == 0) {
pr_err("Invalid time string\n");
return -E... | [
0,
0
] |
Linux Kernel | tools/perf/builtin-diff.c |
static int __cmd_diff(void) {
struct data__file *d;
int ret, i;
char *abstime_ostr, *abstime_tmp;
ret = abstime_str_dup(&abstime_ostr);
if (ret)
return ret;
abstime_tmp = abstime_ostr;
ret = -EINVAL;
data__for_each_file(i, d) {
d->session = perf_session__new(&d->data, &pdiff.tool);
if (I... | [
1,
0
] |
Linux Kernel | tools/perf/builtin-diff.c |
static double baseline_percent(struct hist_entry *he) {
u64 total = hists__total_period(he->hists);
return 100.0 * he->stat.period / total;
} | [
0,
0
] |
Linux Kernel | tools/perf/builtin-diff.c |
static int hpp__color_baseline(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp,
struct hist_entry *he) {
struct diff_hpp_fmt *dfmt = container_of(fmt, struct diff_hpp_fmt, fmt);
double percent = baseline_percent(he);
char pfmt[20] = " ";
if (!he->dummy) {
scnprintf(pfmt, 20, ... | [
1,
0
] |
Linux Kernel | tools/perf/builtin-diff.c | static int hpp__color_cycles_hist(struct perf_hpp_fmt *fmt,
struct perf_hpp *hpp, struct hist_entry *he) {
struct diff_hpp_fmt *dfmt = container_of(fmt, struct diff_hpp_fmt, fmt);
struct hist_entry *pair = get_pair_fmt(he, dfmt);
struct block_hist *bh = container_of(he, struct bl... | [
1,
0
] |
Linux Kernel | tools/perf/builtin-diff.c | static void __hpp__entry_global(struct hist_entry *he,
struct diff_hpp_fmt *dfmt, char *buf,
size_t size) {
struct hist_entry *pair = get_pair_fmt(he, dfmt);
int idx = dfmt->idx;
if (idx == PERF_HPP_DIFF__BASELINE)
hpp__entry_baseline(he, buf, s... | [
0,
0
] |
Linux Kernel | tools/perf/builtin-diff.c |
static int hpp__header(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp,
struct hists *hists __maybe_unused,
int line __maybe_unused, int *span __maybe_unused) {
struct diff_hpp_fmt *dfmt = container_of(fmt, struct diff_hpp_fmt, fmt);
BUG_ON(!dfmt->header);
return scn... | [
0,
0
] |
Linux Kernel | tools/perf/builtin-diff.c | static void data__hpp_register(struct data__file *d, int idx) {
struct diff_hpp_fmt *dfmt = &d->fmt[idx];
struct perf_hpp_fmt *fmt = &dfmt->fmt;
dfmt->idx = idx;
fmt->header = hpp__header;
fmt->width = hpp__width;
fmt->entry = hpp__entry_global;
fmt->cmp = hist_entry__cmp_nop;
fmt->collapse = hist_ent... | [
0,
1
] |
Linux Kernel | tools/perf/builtin-diff.c |
static int diff__config(const char *var, const char *value,
void *cb __maybe_unused) {
if (!strcmp(var, "diff.order")) {
int ret;
if (perf_config_int(&ret, var, value) < 0)
return -1;
sort_compute = ret;
return 0;
}
if (!strcmp(var, "diff.compute")) {
if (!strcmp... | [
0,
0
] |
Linux Kernel | tools/perf/builtin-ftrace.c |
static int read_tracing_file_by_line(const char *name,
void (*cb)(char *str, void *arg),
void *cb_arg) {
char *line = NULL;
size_t len = 0;
char *file;
FILE *fp;
file = get_tracing_file(name);
if (!file) {
pr_debug("cannot get t... | [
1,
0
] |
Linux Kernel | tools/perf/builtin-ftrace.c |
static int write_tracing_file_int(const char *name, int value) {
char buf[16];
snprintf(buf, sizeof(buf), "%d", value);
if (write_tracing_file(name, buf) < 0)
return -1;
return 0;
} | [
1,
0
] |
Linux Kernel | tools/perf/builtin-ftrace.c |
static void reset_tracing_options(struct perf_ftrace *ftrace __maybe_unused) {
write_tracing_option_file("function-fork", "0");
write_tracing_option_file("func_stack_trace", "0");
write_tracing_option_file("sleep-time", "1");
write_tracing_option_file("funcgraph-irqs", "1");
write_tracing_option_file("funcgr... | [
0,
0
] |
Linux Kernel | tools/perf/builtin-ftrace.c |
static void reset_tracing_filters(void) {
write_tracing_file("set_ftrace_filter", " ");
write_tracing_file("set_ftrace_notrace", " ");
write_tracing_file("set_graph_function", " ");
write_tracing_file("set_graph_notrace", " ");
} | [
0,
0
] |
Linux Kernel | tools/perf/builtin-ftrace.c |
static int set_tracing_depth(struct perf_ftrace *ftrace) {
if (ftrace->graph_depth == 0)
return 0;
if (ftrace->graph_depth < 0) {
pr_err("invalid graph depth: %d\n", ftrace->graph_depth);
return -1;
}
if (write_tracing_file_int("max_graph_depth", ftrace->graph_depth) < 0)
return -1;
return... | [
0,
0
] |
Linux Kernel | tools/perf/builtin-ftrace.c |
static int set_tracing_sleep_time(struct perf_ftrace *ftrace) {
if (!ftrace->graph_nosleep_time)
return 0;
if (write_tracing_option_file("sleep-time", "0") < 0)
return -1;
return 0;
} | [
0,
0
] |
Linux Kernel | tools/perf/builtin-ftrace.c |
static int set_tracing_funcgraph_verbose(struct perf_ftrace *ftrace) {
if (!ftrace->graph_verbose)
return 0;
if (write_tracing_option_file("funcgraph-proc", "1") < 0)
return -1;
if (write_tracing_option_file("funcgraph-abstime", "1") < 0)
return -1;
if (write_tracing_option_file("latency-format"... | [
0,
0
] |
Linux Kernel | tools/perf/builtin-ftrace.c |
static int set_tracing_options(struct perf_ftrace *ftrace) {
if (set_tracing_pid(ftrace) < 0) {
pr_err("failed to set ftrace pid\n");
return -1;
}
if (set_tracing_cpu(ftrace) < 0) {
pr_err("failed to set tracing cpumask\n");
return -1;
}
if (set_tracing_func_stack_trace(ftrace) < 0) {
p... | [
1,
0
] |
Linux Kernel | tools/perf/builtin-ftrace.c | static void display_histogram(int buckets[], bool use_nsec) {
int i;
int total = 0;
int bar_total = 46;
char bar[] = "###############################################";
int bar_len;
for (i = 0; i < NUM_BUCKET; i++)
total += buckets[i];
if (total == 0) {
printf("No data found\n");
return;
}
... | [
1,
0
] |
Linux Kernel | tools/perf/builtin-ftrace.c |
static int stop_func_latency(struct perf_ftrace *ftrace) {
if (ftrace->target.use_bpf)
return perf_ftrace__latency_stop_bpf(ftrace);
write_tracing_file("tracing_on", "0");
return 0;
} | [
0,
0
] |
Linux Kernel | tools/perf/builtin-ftrace.c | static int __cmd_latency(struct perf_ftrace *ftrace) {
int trace_fd;
char buf[4096];
char line[256];
struct pollfd pollfd = {
.events = POLLIN,
};
int buckets[NUM_BUCKET] = {};
if (!(perf_cap__capable(CAP_PERFMON) || perf_cap__capable(CAP_SYS_ADMIN))) {
pr_err("ftrace only works for %s!\n",
#if... | [
1,
0
] |
Linux Kernel | tools/perf/builtin-ftrace.c |
static void list_function_cb(char *str, void *arg) {
struct strfilter *filter = (struct strfilter *)arg;
if (strfilter__compare(filter, str))
printf("%s", str);
} | [
0,
0
] |
Linux Kernel | tools/perf/builtin-ftrace.c |
static int parse_func_tracer_opts(const struct option *opt, const char *str,
int unset) {
int ret;
struct perf_ftrace *ftrace = (struct perf_ftrace *)opt->value;
struct sublevel_option func_tracer_opts[] = {
{.name = "call-graph", .value_ptr = &ftrace->func_stack_trace},
... | [
0,
0
] |
Linux Kernel | tools/perf/builtin-ftrace.c |
static int parse_graph_tracer_opts(const struct option *opt, const char *str,
int unset) {
int ret;
struct perf_ftrace *ftrace = (struct perf_ftrace *)opt->value;
struct sublevel_option graph_tracer_opts[] = {
{.name = "nosleep-time", .value_ptr = &ftrace->graph_nosleep_t... | [
0,
0
] |
Linux Kernel | tools/perf/builtin-help.c | static int check_emacsclient_version(void) {
struct strbuf buffer = STRBUF_INIT;
struct child_process ec_process;
const char *argv_ec[] = {"emacsclient", "--version", NULL};
int version;
int ret = -1;
memset(&ec_process, 0, sizeof(ec_process));
ec_process.argv = argv_ec;
ec_process.err = -1;
ec_proce... | [
1,
0
] |
Linux Kernel | tools/perf/builtin-help.c |
static void exec_failed(const char *cmd) {
char sbuf[STRERR_BUFSIZE];
pr_warning("failed to exec '%s': %s", cmd,
str_error_r(errno, sbuf, sizeof(sbuf)));
} | [
1,
0
] |
Linux Kernel | tools/perf/builtin-help.c | static void exec_man_konqueror(const char *path, const char *page) {
const char *display = getenv("DISPLAY");
if (display && *display) {
char *man_page;
const char *filename = "kfmclient";
if (path) {
const char *file = strrchr(path, '/');
if (file && !strcmp(file + 1, "konqueror")) {
... | [
1,
0
] |
Linux Kernel | tools/perf/builtin-help.c |
static int add_man_viewer_cmd(const char *name, size_t len, const char *value) {
if (supported_man_viewer(name, len))
unsupported_man_viewer(name, "path");
else
do_add_man_viewer_info(name, len, value);
return 0;
} | [
0,
0
] |
Linux Kernel | tools/perf/builtin-help.c |
static int add_man_viewer_info(const char *var, const char *value) {
const char *name = var + 4;
const char *subkey = strrchr(name, '.');
if (!subkey) {
pr_err("Config with no key for man viewer: %s", name);
return -1;
}
if (!strcmp(subkey, ".path")) {
if (!value)
return config_error_nonb... | [
0,
0
] |
Linux Kernel | tools/perf/builtin-help.c |
static int perf_help_config(const char *var, const char *value, void *cb) {
enum help_format *help_formatp = cb;
if (!strcmp(var, "help.format")) {
if (!value)
return config_error_nonbool(var);
*help_formatp = parse_help_format(value);
if (*help_formatp == HELP_FORMAT_NONE)
return -1;
... | [
0,
0
] |
Linux Kernel | tools/perf/builtin-inject.c |
static int output_bytes(struct perf_inject *inject, void *buf, size_t sz) {
ssize_t size;
size = perf_data__write(&inject->output, buf, sz);
if (size < 0)
return -errno;
inject->bytes_written += size;
return 0;
} | [
0,
0
] |
Linux Kernel | tools/perf/builtin-inject.c |
static int
perf_event__repipe_oe_synth(struct perf_tool *tool, union perf_event *event,
struct ordered_events *oe __maybe_unused) {
return perf_event__repipe_synth(tool, event);
} | [
0,
0
] |
Linux Kernel | tools/perf/builtin-inject.c | static int perf_event__drop_oe(struct perf_tool *tool __maybe_unused,
union perf_event *event __maybe_unused,
struct ordered_events *oe __maybe_unused) {
return 0;
}
#endif | [
0,
0
] |
Linux Kernel | tools/perf/builtin-inject.c |
static int perf_event__repipe_op2_synth(struct perf_session *session,
union perf_event *event) {
return perf_event__repipe_synth(session->tool, event);
} | [
0,
0
] |
Linux Kernel | tools/perf/builtin-inject.c |
static int
perf_event__repipe_event_update(struct perf_tool *tool, union perf_event *event,
struct evlist **pevlist __maybe_unused) {
return perf_event__repipe_synth(tool, event);
} | [
0,
0
] |
Linux Kernel | tools/perf/builtin-inject.c |
static s64 perf_event__repipe_auxtrace(struct perf_session *session,
union perf_event *event) {
struct perf_tool *tool = session->tool;
struct perf_inject *inject = container_of(tool, struct perf_inject, tool);
int ret;
inject->have_auxtrace = true;
if (!inject->outpu... | [
0,
0
] |
Linux Kernel | tools/perf/builtin-inject.c |
static int perf_event__drop_aux(struct perf_tool *tool,
union perf_event *event __maybe_unused,
struct perf_sample *sample,
struct machine *machine __maybe_unused) {
struct perf_inject *inject = container_of(tool, struct ... | [
0,
0
] |
Linux Kernel | tools/perf/builtin-inject.c |
static int perf_event__repipe_mmap(struct perf_tool *tool,
union perf_event *event,
struct perf_sample *sample,
struct machine *machine) {
int err;
err = perf_event__process_mmap(tool, event, sample, machine);... | [
0,
0
] |
Linux Kernel | tools/perf/builtin-inject.c | static int perf_event__jit_repipe_mmap(struct perf_tool *tool,
union perf_event *event,
struct perf_sample *sample,
struct machine *machine) {
struct perf_inject *inject = container_of(tool, struct per... | [
0,
0
] |
Linux Kernel | tools/perf/builtin-inject.c | static struct dso *findnew_dso(int pid, int tid, const char *filename,
struct dso_id *id, struct machine *machine) {
struct thread *thread;
struct nsinfo *nsi = NULL;
struct nsinfo *nnsi;
struct dso *dso;
bool vdso;
thread = machine__findnew_thread(machine, pid, tid);
if (t... | [
0,
0
] |
Linux Kernel | tools/perf/builtin-inject.c |
static int perf_event__repipe_buildid_mmap(struct perf_tool *tool,
union perf_event *event,
struct perf_sample *sample,
struct machine *machine) {
struct dso *dso;
dso = findnew_dso(eve... | [
0,
0
] |
Linux Kernel | tools/perf/builtin-inject.c | static int perf_event__repipe_mmap2(struct perf_tool *tool,
union perf_event *event,
struct perf_sample *sample,
struct machine *machine) {
int err;
err = perf_event__process_mmap2(tool, event, sample, machi... | [
0,
0
] |
Linux Kernel | tools/perf/builtin-inject.c | static int perf_event__jit_repipe_mmap2(struct perf_tool *tool,
union perf_event *event,
struct perf_sample *sample,
struct machine *machine) {
struct perf_inject *inject = container_of(tool, struct... | [
0,
0
] |
Linux Kernel | tools/perf/builtin-inject.c |
static int perf_event__repipe_namespaces(struct perf_tool *tool,
union perf_event *event,
struct perf_sample *sample,
struct machine *machine) {
int err = perf_event__process_namespaces(tool, ev... | [
0,
0
] |
Linux Kernel | tools/perf/builtin-inject.c |
static int perf_event__repipe_exit(struct perf_tool *tool,
union perf_event *event,
struct perf_sample *sample,
struct machine *machine) {
int err;
err = perf_event__process_exit(tool, event, sample, machine);... | [
0,
0
] |
Linux Kernel | tools/perf/builtin-inject.c |
static int perf_event__repipe_tracing_data(struct perf_session *session,
union perf_event *event) {
perf_event__repipe_synth(session->tool, event);
return perf_event__process_tracing_data(session, event);
} | [
0,
0
] |
Linux Kernel | tools/perf/builtin-inject.c |
static int perf_inject__sched_switch(struct perf_tool *tool,
union perf_event *event,
struct perf_sample *sample,
struct evsel *evsel,
struct machine *machine) {
struct ... | [
1,
0
] |
Linux Kernel | tools/perf/builtin-inject.c |
static int guest_session__map_tid(struct guest_session *gs, u32 tid, u32 vcpu) {
struct guest_tid *guest_tid = zalloc(sizeof(*guest_tid));
int hash;
if (!guest_tid)
return -ENOMEM;
guest_tid->tid = tid;
guest_tid->vcpu = vcpu;
hash = hash_32(guest_tid->tid, PERF_EVLIST__HLIST_BITS);
hlist_add_head(... | [
0,
0
] |
Linux Kernel | tools/perf/builtin-inject.c | static int host_peek_vm_comms_cb(struct perf_session *session __maybe_unused,
union perf_event *event,
u64 offset __maybe_unused, void *data) {
struct guest_session *gs = data;
unsigned int vcpu;
struct guest_vcpu *guest_vcpu;
int ret;
if (eve... | [
1,
0
] |
Linux Kernel | tools/perf/builtin-inject.c | static int guest_session__add_attr(struct guest_session *gs,
struct evsel *evsel) {
struct perf_inject *inject =
container_of(gs, struct perf_inject, guest_session);
struct perf_event_attr attr = evsel->core.attr;
u64 *id_array;
u32 *vcpu_array;
int ret = -ENOMEM;
u3... | [
1,
0
] |
Linux Kernel | tools/perf/builtin-inject.c |
static u64 evlist__first_id(struct evlist *evlist) {
struct evsel *evsel;
evlist__for_each_entry(evlist, evsel) {
if (evsel->core.ids)
return evsel->core.id[0];
}
return 0;
} | [
0,
0
] |
Linux Kernel | tools/perf/builtin-inject.c | static void free_hlist(struct hlist_head *heads, size_t hlist_sz) {
struct hlist_node *pos, *n;
size_t i;
for (i = 0; i < hlist_sz; ++i) {
hlist_for_each_safe(pos, n, &heads[i]) {
hlist_del(pos);
free(pos);
}
}
} | [
1,
0
] |
Linux Kernel | tools/perf/builtin-inject.c | static void guest_session__convert_time(struct guest_session *gs,
u64 guest_time, u64 *host_time) {
u64 tsc;
if (!guest_time) {
*host_time = 0;
return;
}
if (gs->guest_tc.cap_user_time_zero)
tsc = perf_time_to_tsc(guest_time, &gs->guest_tc);
else
tsc =... | [
0,
0
] |
Linux Kernel | tools/perf/builtin-inject.c | static int guest_session__fetch(struct guest_session *gs) {
void *buf = gs->ev.event_buf;
struct perf_event_header *hdr = buf;
size_t hdr_sz = sizeof(*hdr);
ssize_t ret;
ret = readn(gs->tmp_fd, buf, hdr_sz);
if (ret < 0)
return ret;
if (!ret) {
hdr->size = 0;
return 0;
}
buf += hdr_sz;... | [
1,
0
] |
Linux Kernel | tools/perf/builtin-inject.c | static int host__context_switch(struct perf_tool *tool, union perf_event *event,
struct perf_sample *sample,
struct machine *machine) {
struct perf_inject *inject = container_of(tool, struct perf_inject, tool);
bool out = event->header.misc & PERF_RECO... | [
1,
0
] |
Linux Kernel | tools/perf/builtin-inject.c |
static int feat_copy(struct perf_inject *inject, int feat,
struct feat_writer *fw) {
int fd = perf_data__fd(inject->session->data);
u64 offs = inject->secs[feat].offset;
size_t sz = inject->secs[feat].size;
void *buf = malloc(sz);
int ret;
if (!buf)
return -ENOMEM;
ret = read_f... | [
1,
0
] |
Linux Kernel | tools/perf/builtin-inject.c |
static int copy_kcore_dir(struct perf_inject *inject) {
char *cmd;
int ret;
ret = asprintf(&cmd, "cp -r -n %s/kcore_dir* %s >/dev/null 2>&1",
inject->input_name, inject->output.path);
if (ret < 0)
return ret;
pr_debug("%s\n", cmd);
ret = system(cmd);
free(cmd);
return ret;
} | [
1,
0
] |
Linux Kernel | tools/perf/builtin-kallsyms.c |
int cmd_kallsyms(int argc, const char **argv) {
const struct option options[] = {
OPT_INCR('v', "verbose", &verbose,
"be more verbose (show counter open errors, etc)"),
OPT_END()};
const char *const kallsyms_usage[] = {"perf kallsyms [<options>] symbol_name",
... | [
0,
0
] |
Linux Kernel | tools/perf/builtin-kmem.c | static u64 find_callsite(struct evsel *evsel, struct perf_sample *sample) {
struct addr_location al;
struct machine *machine = &kmem_session->machines.host;
struct callchain_cursor_node *node;
if (alloc_func_list == NULL) {
if (build_alloc_func_list() < 0)
goto out;
}
al.thread = machine__findne... | [
1,
0
] |
Linux Kernel | tools/perf/builtin-kmem.c |
static struct page_stat *page_stat__findnew_page(struct page_stat *pstat) {
return __page_stat__findnew_page(pstat, true);
} | [
0,
0
] |
Linux Kernel | tools/perf/builtin-kmem.c |
static struct page_stat *page_stat__findnew_alloc(struct page_stat *pstat) {
return __page_stat__findnew_alloc(pstat, true);
} | [
0,
0
] |
Linux Kernel | tools/perf/builtin-kmem.c |
static bool valid_page(u64 pfn_or_page) {
if (use_pfn && pfn_or_page == -1UL)
return false;
if (!use_pfn && pfn_or_page == 0)
return false;
return true;
} | [
1,
0
] |
Linux Kernel | tools/perf/builtin-kmem.c |
static int gfpcmp(const void *a, const void *b) {
const struct gfp_flag *fa = a;
const struct gfp_flag *fb = b;
return fa->flags - fb->flags;
} | [
0,
0
] |
Linux Kernel | tools/perf/builtin-kmem.c |
static int process_sample_event(struct perf_tool *tool __maybe_unused,
union perf_event *event,
struct perf_sample *sample, struct evsel *evsel,
struct machine *machine) {
int err = 0;
struct thread *thread =
mach... | [
0,
0
] |
Linux Kernel | tools/perf/builtin-kmem.c |
static void __print_slab_result(struct rb_root *root,
struct perf_session *session, int n_lines,
int is_caller) {
struct rb_node *next;
struct machine *machine = &session->machines.host;
printf("%.105s\n", graph_dotted_line);
printf(" %-34s |", i... | [
1,
0
] |
Linux Kernel | tools/perf/builtin-kmem.c |
static void __print_page_caller_result(struct perf_session *session,
int n_lines) {
struct rb_node *next = rb_first(&page_caller_sorted);
struct machine *machine = &session->machines.host;
int gfp_len = max(strlen("GFP flags"), max_gfp_len);
printf("\n%.105s\n", graph_do... | [
1,
0
] |
Linux Kernel | tools/perf/builtin-kmem.c |
static void print_slab_summary(void) {
printf("\nSUMMARY (SLAB allocator)");
printf("\n========================\n");
printf("Total bytes requested: %'lu\n", total_requested);
printf("Total bytes allocated: %'lu\n", total_allocated);
printf("Total bytes freed: %'lu\n", total_freed);
if (total_allocated ... | [
0,
0
] |
Linux Kernel | tools/perf/builtin-kmem.c |
static void print_result(struct perf_session *session) {
if (kmem_slab)
print_slab_result(session);
if (kmem_page)
print_page_result(session);
} | [
0,
0
] |
Linux Kernel | tools/perf/builtin-kmem.c |
static void sort_slab_insert(struct rb_root *root, struct alloc_stat *data,
struct list_head *sort_list) {
struct rb_node **new = &(root->rb_node);
struct rb_node *parent = NULL;
struct sort_dimension *sort;
while (*new) {
struct alloc_stat *this;
int cmp = 0;
this = ... | [
0,
0
] |
Linux Kernel | tools/perf/builtin-kmem.c | static int __cmd_kmem(struct perf_session *session) {
int err = -EINVAL;
struct evsel *evsel;
const struct evsel_str_handler kmem_tracepoints[] = {
{
"kmem:kmalloc",
evsel__process_alloc_event,
},
{
"kmem:kmem_cache_alloc",
evsel__process_alloc_event,
... | [
0,
0
] |
Linux Kernel | tools/perf/builtin-kmem.c |
static int slab_callsite_cmp(void *a, void *b) {
struct alloc_stat *l = a;
struct alloc_stat *r = b;
if (l->call_site < r->call_site)
return -1;
else if (l->call_site > r->call_site)
return 1;
return 0;
} | [
0,
0
] |
Linux Kernel | tools/perf/builtin-kmem.c |
static int page_callsite_cmp(void *a, void *b) {
struct page_stat *l = a;
struct page_stat *r = b;
if (l->callsite < r->callsite)
return -1;
else if (l->callsite > r->callsite)
return 1;
return 0;
} | [
0,
0
] |
Linux Kernel | tools/perf/builtin-kmem.c |
static int page_bytes_cmp(void *a, void *b) {
struct page_stat *l = a;
struct page_stat *r = b;
if (l->alloc_bytes < r->alloc_bytes)
return -1;
else if (l->alloc_bytes > r->alloc_bytes)
return 1;
return 0;
} | [
0,
0
] |
Linux Kernel | tools/perf/builtin-kmem.c | static int gfp_flags_cmp(void *a, void *b) {
struct page_stat *l = a;
struct page_stat *r = b;
if (l->gfp_flags == -1U)
return 0;
if (l->gfp_flags < r->gfp_flags)
return -1;
else if (l->gfp_flags > r->gfp_flags)
return 1;
return 0;
} | [
0,
0
] |
Linux Kernel | tools/perf/builtin-kmem.c |
static int slab_sort_dimension__add(const char *tok, struct list_head *list) {
struct sort_dimension *sort;
int i;
for (i = 0; i < (int)ARRAY_SIZE(slab_sorts); i++) {
if (!strcmp(slab_sorts[i]->name, tok)) {
sort = memdup(slab_sorts[i], sizeof(*slab_sorts[i]));
if (!sort) {
pr_err("%s: m... | [
1,
0
] |
Linux Kernel | tools/perf/builtin-kmem.c |
static int parse_sort_opt(const struct option *opt __maybe_unused,
const char *arg, int unset __maybe_unused) {
if (!arg)
return -1;
if (kmem_page > kmem_slab ||
(kmem_page == 0 && kmem_slab == 0 && kmem_default == KMEM_PAGE)) {
if (caller_flag > alloc_flag)
return se... | [
1,
0
] |
Linux Kernel | tools/perf/builtin-kmem.c |
static int parse_alloc_opt(const struct option *opt __maybe_unused,
const char *arg __maybe_unused,
int unset __maybe_unused) {
alloc_flag = (caller_flag + 1);
return 0;
} | [
0,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.