Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | tools/perf/util/sort.c |
static int hist_entry__data_page_size_snprintf(struct hist_entry *he, char *bf,
size_t size,
unsigned int width) {
char str[PAGE_SIZE_NAME_LEN];
return repsep_snprintf(
bf, size, "%-*s", width,
get_page_size_... | [
0,
0
] |
Linux Kernel | tools/perf/util/sort.c |
static int64_t sort__code_page_size_cmp(struct hist_entry *left,
struct hist_entry *right) {
uint64_t l = left->code_page_size;
uint64_t r = right->code_page_size;
return (int64_t)(r - l);
} | [
0,
0
] |
Linux Kernel | tools/perf/util/sort.c |
static int64_t sort__in_tx_cmp(struct hist_entry *left,
struct hist_entry *right) {
if (!left->branch_info || !right->branch_info)
return cmp_null(left->branch_info, right->branch_info);
return left->branch_info->flags.in_tx != right->branch_info->flags.in_tx;
} | [
1,
0
] |
Linux Kernel | tools/perf/util/sort.c |
static int _hist_entry__dso_size_snprintf(struct map *map, char *bf,
size_t bf_size, unsigned int width) {
if (map && map->dso)
return repsep_snprintf(bf, bf_size, "%*d", width, map__size(map));
return repsep_snprintf(bf, bf_size, "%*s", width, "unknown");
} | [
1,
0
] |
Linux Kernel | tools/perf/util/sort.c | static int64_t sort__addr_cmp(struct hist_entry *left,
struct hist_entry *right) {
u64 left_ip = left->ip;
u64 right_ip = right->ip;
struct map *left_map = left->ms.map;
struct map *right_map = right->ms.map;
if (left_map)
left_ip = left_map->unmap_ip(left_map, left_ip);
i... | [
0,
0
] |
Linux Kernel | tools/perf/util/sort.c |
int __weak arch_support_sort_key(const char *sort_key __maybe_unused) {
return 0;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/sort.c |
const char *__weak arch_perf_header_entry(const char *se_header) {
return se_header;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/sort.c |
static int64_t __sort__hpp_cmp(struct perf_hpp_fmt *fmt, struct hist_entry *a,
struct hist_entry *b) {
struct hpp_sort_entry *hse;
hse = container_of(fmt, struct hpp_sort_entry, hpp);
return hse->se->se_cmp(a, b);
} | [
0,
0
] |
Linux Kernel | tools/perf/util/sort.c |
static void hse_free(struct perf_hpp_fmt *fmt) {
struct hpp_sort_entry *hse;
hse = container_of(fmt, struct hpp_sort_entry, hpp);
free(hse);
} | [
1,
0
] |
Linux Kernel | tools/perf/util/sort.c |
static struct hpp_sort_entry *
__sort_dimension__alloc_hpp(struct sort_dimension *sd, int level) {
struct hpp_sort_entry *hse;
hse = malloc(sizeof(*hse));
if (hse == NULL) {
pr_err("Memory allocation failed\n");
return NULL;
}
hse->se = sd->entry;
hse->hpp.name = sd->entry->se_header;
hse->hpp.... | [
1,
0
] |
Linux Kernel | tools/perf/util/sort.c | static int hde_width(struct hpp_dynamic_entry *hde) {
if (!hde->hpp.len) {
int len = hde->dynamic_len;
int namelen = strlen(hde->field->name);
int fieldlen = hde->field->size;
if (namelen > len)
len = namelen;
if (!(hde->field->flags & TEP_FIELD_IS_STRING)) {
fieldlen = hde->field->... | [
1,
0
] |
Linux Kernel | tools/perf/util/sort.c |
bool perf_hpp__is_dynamic_entry(struct perf_hpp_fmt *fmt) {
return fmt->cmp == __sort__hde_cmp;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/sort.c |
static int parse_field_name(char *str, char **event, char **field, char **opt) {
char *event_name, *field_name, *opt_name;
event_name = str;
field_name = strchr(str, '.');
if (field_name) {
*field_name++ = '\0';
} else {
event_name = NULL;
field_name = str;
}
opt_name = strchr(field_name, ... | [
0,
0
] |
Linux Kernel | tools/perf/util/sort.c |
static int __dynamic_dimension__add(struct evsel *evsel,
struct tep_format_field *field,
bool raw_trace, int level) {
struct hpp_dynamic_entry *hde;
hde = __alloc_dynamic_entry(evsel, field, level);
if (hde == NULL)
return -ENOMEM;
h... | [
0,
0
] |
Linux Kernel | tools/perf/util/sort.c |
static int add_all_dynamic_fields(struct evlist *evlist, bool raw_trace,
int level) {
int ret;
struct evsel *evsel;
evlist__for_each_entry(evlist, evsel) {
if (evsel->core.attr.type != PERF_TYPE_TRACEPOINT)
continue;
ret = add_evsel_fields(evsel, raw_trace, level... | [
0,
0
] |
Linux Kernel | tools/perf/util/sort.c |
static int add_dynamic_entry(struct evlist *evlist, const char *tok,
int level) {
char *str, *event_name, *field_name, *opt_name;
struct evsel *evsel;
struct tep_format_field *field;
bool raw_trace = symbol_conf.raw_trace;
int ret = 0;
if (evlist == NULL)
return -ENOENT;
... | [
1,
0
] |
Linux Kernel | tools/perf/util/sort.c |
static int __sort_dimension__add(struct sort_dimension *sd,
struct perf_hpp_list *list, int level) {
if (sd->taken)
return 0;
if (__sort_dimension__add_hpp_sort(sd, list, level) < 0)
return -1;
if (sd->entry->se_collapse)
list->need_collapse = 1;
sd->taken = 1;
... | [
0,
0
] |
Linux Kernel | tools/perf/util/sort.c |
static int __hpp_dimension__add(struct hpp_dimension *hd,
struct perf_hpp_list *list, int level) {
struct perf_hpp_fmt *fmt;
if (hd->taken)
return 0;
fmt = __hpp_dimension__alloc_hpp(hd, level);
if (!fmt)
return -1;
hd->taken = 1;
perf_hpp_list__register_sort_fiel... | [
0,
0
] |
Linux Kernel | tools/perf/util/sort.c | static int setup_sort_order(struct evlist *evlist) {
char *new_sort_order;
if (!sort_order || is_strict_order(sort_order))
return 0;
if (sort_order[1] == '\0') {
ui__error("Invalid --sort key: `+'");
return -EINVAL;
}
/*
* We allocate new sort_order string, but we never free it,
* because... | [
0,
0
] |
Linux Kernel | tools/perf/util/sort.c |
void perf_hpp__set_elide(int idx, bool elide) {
struct perf_hpp_fmt *fmt;
struct hpp_sort_entry *hse;
perf_hpp_list__for_each_format(&perf_hpp_list, fmt) {
if (!perf_hpp__is_sort_entry(fmt))
continue;
hse = container_of(fmt, struct hpp_sort_entry, hpp);
if (hse->se->se_width_idx == idx) {
... | [
1,
0
] |
Linux Kernel | tools/perf/util/sort.c |
int output_field_add(struct perf_hpp_list *list, char *tok) {
unsigned int i;
for (i = 0; i < ARRAY_SIZE(common_sort_dimensions); i++) {
struct sort_dimension *sd = &common_sort_dimensions[i];
if (strncasecmp(tok, sd->name, strlen(tok)))
continue;
return __sort_dimension__add_output(list, sd);... | [
0,
0
] |
Linux Kernel | tools/perf/util/sort.c |
static int setup_output_list(struct perf_hpp_list *list, char *str) {
char *tmp, *tok;
int ret = 0;
for (tok = strtok_r(str, ", ", &tmp); tok; tok = strtok_r(NULL, ", ", &tmp)) {
ret = output_field_add(list, tok);
if (ret == -EINVAL) {
ui__error("Invalid --fields key: `%s'", tok);
break;
... | [
0,
0
] |
Linux Kernel | tools/perf/util/sort.c |
bool is_strict_order(const char *order) { return order && (*order != '+'); } | [
0,
0
] |
Linux Kernel | tools/perf/util/sort.c | int setup_sorting(struct evlist *evlist) {
int err;
err = __setup_sorting(evlist);
if (err < 0)
return err;
if (parent_pattern != default_parent_pattern) {
err = sort_dimension__add(&perf_hpp_list, "parent", evlist, -1);
if (err < 0)
return err;
}
reset_dimensions();
if (sort__mode !... | [
0,
0
] |
Linux Kernel | tools/perf/util/sort.h |
static __pure inline bool hist_entry__has_callchains(struct hist_entry *he) {
return he->callchain_size != 0;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/sort.h |
static inline float hist_entry__get_percent_limit(struct hist_entry *he) {
u64 period = he->stat.period;
u64 total_period = hists__total_period(he->hists);
if (unlikely(total_period == 0))
return 0;
if (symbol_conf.cumulate_callchain)
period = he->stat_acc->period;
return period * 100.0 / total_pe... | [
0,
0
] |
Linux Kernel | tools/perf/util/spark.c | int print_spark(char *bf, int size, unsigned long *val, int numval) {
static const char *ticks[NUM_SPARKS] = {"▁", "▂", "▃", "▄",
"▅", "▆", "▇", "█"};
int i, printed = 0;
unsigned long min = ULONG_MAX, max = 0, f;
for (i = 0; i < numval; i++) {
if (val[i] < min)
... | [
1,
0
] |
Linux Kernel | tools/perf/util/srcline.c |
static int inline_list__append(struct symbol *symbol, char *srcline,
struct inline_node *node) {
struct inline_list *ilist;
ilist = zalloc(sizeof(*ilist));
if (ilist == NULL)
return -1;
ilist->symbol = symbol;
ilist->srcline = srcline;
if (callchain_param.order == ORDE... | [
0,
0
] |
Linux Kernel | tools/perf/util/srcline.c |
static char *srcline_from_fileline(const char *file, unsigned int line) {
char *srcline;
if (!file)
return NULL;
if (!srcline_full_filename)
file = gnu_basename(file);
if (asprintf(&srcline, "%s:%u", file, line) < 0)
return NULL;
return srcline;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/srcline.c |
static void find_address_in_section(bfd *abfd, asection *section, void *data) {
bfd_vma pc, vma;
bfd_size_type size;
struct a2l_data *a2l = data;
flagword flags;
if (a2l->found)
return;
#ifdef bfd_get_section_flags
flags = bfd_get_section_flags(abfd, section);
#else
flags = bfd_section_flags(sectio... | [
1,
0
] |
Linux Kernel | tools/perf/util/srcline.c |
static void addr2line_cleanup(struct a2l_data *a2l) {
if (a2l->abfd)
bfd_close(a2l->abfd);
zfree((char **)&a2l->input);
zfree(&a2l->syms);
free(a2l);
} | [
1,
0
] |
Linux Kernel | tools/perf/util/srcline.c |
static int inline_list__append_dso_a2l(struct dso *dso,
struct inline_node *node,
struct symbol *sym) {
struct a2l_data *a2l = dso->a2l;
struct symbol *inline_sym = new_inline_sym(dso, sym, a2l->funcname);
char *srcline = NULL;
if (... | [
0,
0
] |
Linux Kernel | tools/perf/util/srcline.c | static int addr2line(const char *dso_name, u64 addr, char **file,
unsigned int *line, struct dso *dso, bool unwind_inlines,
struct inline_node *node, struct symbol *sym) {
int ret = 0;
struct a2l_data *a2l = dso->a2l;
if (!a2l) {
dso->a2l = addr2line_init(dso_name);
... | [
0,
0
] |
Linux Kernel | tools/perf/util/srcline.c | static void addr2line_subprocess_cleanup(struct a2l_subprocess *a2l) {
if (a2l->addr2line.pid != -1) {
kill(a2l->addr2line.pid, SIGKILL);
finish_command(&a2l->addr2line);
a2l->addr2line.pid = -1;
}
if (a2l->to_child != NULL) {
fclose(a2l->to_child);
a2l->to_child = NULL;
}
if (a2l->from_... | [
1,
0
] |
Linux Kernel | tools/perf/util/srcline.c | char *get_srcline_split(struct dso *dso, u64 addr, unsigned *line) {
char *file = NULL;
const char *dso_name;
if (!dso->has_srcline)
goto out;
dso_name = dso__name(dso);
if (dso_name == NULL)
goto out;
if (!addr2line(dso_name, addr, &file, line, dso, true, NULL, NULL))
goto out;
dso->a2l_f... | [
1,
0
] |
Linux Kernel | tools/perf/util/srcline.c |
char *get_srcline(struct dso *dso, u64 addr, struct symbol *sym, bool show_sym,
bool show_addr, u64 ip) {
return __get_srcline(dso, addr, sym, show_sym, show_addr, false, ip);
} | [
0,
0
] |
Linux Kernel | tools/perf/util/srcline.c |
char *srcline__tree_find(struct rb_root_cached *tree, u64 addr) {
struct rb_node *n = tree->rb_root.rb_node;
while (n) {
struct srcline_node *i = rb_entry(n, struct srcline_node, rb_node);
if (addr < i->addr)
n = n->rb_left;
else if (addr > i->addr)
n = n->rb_right;
else
return ... | [
0,
0
] |
Linux Kernel | tools/perf/util/stat-display.c |
static void print_running(struct perf_stat_config *config, u64 run, u64 ena) {
double enabled_percent = 100;
if (run != ena)
enabled_percent = 100 * run / ena;
if (config->json_output)
fprintf(config->output,
"\"event-runtime\" : %" PRIu64 ", \"pcnt-running\" : %.2f, ", run,
ena... | [
1,
0
] |
Linux Kernel | tools/perf/util/stat-display.c |
static void print_cgroup(struct perf_stat_config *config, struct evsel *evsel) {
if (nr_cgroups) {
const char *cgrp_name = evsel->cgrp ? evsel->cgrp->name : "";
if (config->json_output)
fprintf(config->output, "\"cgroup\" : \"%s\", ", cgrp_name);
else
fprintf(config->output, "%s%s", config->... | [
0,
0
] |
Linux Kernel | tools/perf/util/stat-display.c |
static void print_metric_csv(struct perf_stat_config *config __maybe_unused,
void *ctx, const char *color __maybe_unused,
const char *fmt, const char *unit, double val) {
struct outstate *os = ctx;
FILE *out = os->fh;
char buf[64], *vals, *ends;
if (un... | [
1,
0
] |
Linux Kernel | tools/perf/util/stat-display.c |
static void
print_metric_only_json(struct perf_stat_config *config __maybe_unused,
void *ctx, const char *color __maybe_unused,
const char *fmt, const char *unit, double val) {
struct outstate *os = ctx;
FILE *out = os->fh;
char buf[64], *vals, *ends;
char tbuf[102... | [
1,
0
] |
Linux Kernel | tools/perf/util/stat-display.c |
static void abs_printout(struct perf_stat_config *config, struct aggr_cpu_id id,
int nr, struct evsel *evsel, double avg) {
FILE *output = config->output;
double sc = evsel->scale;
const char *fmt;
if (config->csv_output) {
fmt = floor(sc) != sc ? "%.2f%s" : "%.0f%s";
} else {
... | [
1,
0
] |
Linux Kernel | tools/perf/util/stat-display.c |
static void aggr_update_shadow(struct perf_stat_config *config,
struct evlist *evlist) {
int idx, s;
struct perf_cpu cpu;
struct aggr_cpu_id s2, id;
u64 val;
struct evsel *counter;
struct perf_cpu_map *cpus;
for (s = 0; s < config->aggr_map->nr; s++) {
id = config->agg... | [
1,
0
] |
Linux Kernel | tools/perf/util/stat-display.c |
static void uniquify_event_name(struct evsel *counter) {
char *new_name;
char *config;
int ret = 0;
if (counter->uniquified_name || counter->use_config_name ||
!counter->pmu_name ||
!strncmp(counter->name, counter->pmu_name, strlen(counter->pmu_name)))
return;
config = strchr(counter->name,... | [
1,
0
] |
Linux Kernel | tools/perf/util/stat-display.c |
static bool is_uncore(struct evsel *evsel) {
struct perf_pmu *pmu = evsel__find_pmu(evsel);
return pmu && pmu->is_uncore;
} | [
1,
0
] |
Linux Kernel | tools/perf/util/stat-display.c |
static bool hybrid_uniquify(struct evsel *evsel) {
return perf_pmu__has_hybrid() && !is_uncore(evsel);
} | [
0,
0
] |
Linux Kernel | tools/perf/util/stat-display.c | static void print_aggr(struct perf_stat_config *config, struct evlist *evlist,
char *prefix) {
bool metric_only = config->metric_only;
FILE *output = config->output;
struct evsel *counter;
int s;
bool first;
if (!config->aggr_map || !config->aggr_get_id)
return;
aggr_update_sh... | [
1,
0
] |
Linux Kernel | tools/perf/util/stat-display.c |
static void print_aggr_thread(struct perf_stat_config *config,
struct target *_target, struct evsel *counter,
char *prefix) {
FILE *output = config->output;
int thread, sorted_threads;
struct aggr_cpu_id id;
struct perf_aggr_thread_value *buf;
buf ... | [
1,
0
] |
Linux Kernel | tools/perf/util/stat-display.c | static void print_metric_headers(struct perf_stat_config *config,
struct evlist *evlist, const char *prefix,
bool no_indent) {
struct perf_stat_output_ctx out;
struct evsel *counter;
struct outstate os = {.fh = config->output};
bool first = true;... | [
1,
0
] |
Linux Kernel | tools/perf/util/stat-display.c |
static double timeval2double(struct timeval *t) {
return t->tv_sec + (double)t->tv_usec / USEC_PER_SEC;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/stat-shadow.c | static int saved_value_cmp(struct rb_node *rb_node, const void *entry) {
struct saved_value *a = container_of(rb_node, struct saved_value, rb_node);
const struct saved_value *b = entry;
if (a->map_idx != b->map_idx)
return a->map_idx - b->map_idx;
if (a->type != b->type)
return a->type - b->type;
i... | [
0,
0
] |
Linux Kernel | tools/perf/util/stat-shadow.c |
void perf_stat__init_shadow_stats(void) { runtime_stat__init(&rt_stat); } | [
0,
0
] |
Linux Kernel | tools/perf/util/stat-shadow.c |
static void reset_stat(struct runtime_stat *st) {
struct rblist *rblist;
struct rb_node *pos, *next;
rblist = &st->value_list;
next = rb_first_cached(&rblist->entries);
while (next) {
pos = next;
next = rb_next(pos);
memset(&container_of(pos, struct saved_value, rb_node)->stats, 0,
si... | [
1,
0
] |
Linux Kernel | tools/perf/util/stat-shadow.c |
static void print_l1_dcache_misses(struct perf_stat_config *config, int map_idx,
double avg, struct perf_stat_output_ctx *out,
struct runtime_stat *st,
struct runtime_stat_data *rsd) {
double total, ratio = 0.0;
... | [
1,
0
] |
Linux Kernel | tools/perf/util/stat-shadow.c |
static void print_ll_cache_misses(struct perf_stat_config *config, int map_idx,
double avg, struct perf_stat_output_ctx *out,
struct runtime_stat *st,
struct runtime_stat_data *rsd) {
double total, ratio = 0.0;
co... | [
1,
0
] |
Linux Kernel | tools/perf/util/stat-shadow.c |
static double td_retiring(int map_idx, struct runtime_stat *st,
struct runtime_stat_data *rsd) {
double retiring = 0;
double total_slots = td_total_slots(map_idx, st, rsd);
double ret_slots =
runtime_stat_avg(st, STAT_TOPDOWN_SLOTS_RETIRED, map_idx, rsd);
if (total_slots)
r... | [
0,
0
] |
Linux Kernel | tools/perf/util/stat-shadow.c |
static void print_smi_cost(struct perf_stat_config *config, int map_idx,
struct perf_stat_output_ctx *out,
struct runtime_stat *st,
struct runtime_stat_data *rsd) {
double smi_num, aperf, cycles, cost = 0.0;
const char *color = NULL;
... | [
1,
0
] |
Linux Kernel | tools/perf/util/stat-shadow.c |
double test_generic_metric(struct metric_expr *mexp, int map_idx,
struct runtime_stat *st) {
struct expr_parse_ctx *pctx;
double ratio = 0.0;
pctx = expr__ctx_new();
if (!pctx)
return NAN;
if (prepare_metric(mexp->metric_events, mexp->metric_refs, pctx, map_idx,
... | [
1,
0
] |
Linux Kernel | tools/perf/util/stat.c | static void perf_stat_evsel_id_init(struct evsel *evsel) {
struct perf_stat_evsel *ps = evsel->stats;
int i;
for (i = 0; i < PERF_STAT_EVSEL_ID__MAX; i++) {
if (!strcmp(evsel__name(evsel), id_str[i]) ||
(strstr(evsel__name(evsel), id_str[i]) && evsel->pmu_name &&
strstr(evsel__name(evsel), e... | [
0,
0
] |
Linux Kernel | tools/perf/util/stat.c |
static int evsel__alloc_stat_priv(struct evsel *evsel) {
evsel->stats = zalloc(sizeof(struct perf_stat_evsel));
if (evsel->stats == NULL)
return -ENOMEM;
perf_stat_evsel_id_init(evsel);
evsel__reset_stat_priv(evsel);
return 0;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/stat.c |
static int evsel__alloc_prev_raw_counts(struct evsel *evsel) {
int cpu_map_nr = evsel__nr_cpus(evsel);
int nthreads = perf_thread_map__nr(evsel->core.threads);
struct perf_counts *counts;
counts = perf_counts__new(cpu_map_nr, nthreads);
if (counts)
evsel->prev_raw_counts = counts;
return counts ? 0 :... | [
0,
0
] |
Linux Kernel | tools/perf/util/stat.c |
static void evsel__free_prev_raw_counts(struct evsel *evsel) {
perf_counts__delete(evsel->prev_raw_counts);
evsel->prev_raw_counts = NULL;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/stat.c |
void evlist__copy_prev_raw_counts(struct evlist *evlist) {
struct evsel *evsel;
evlist__for_each_entry(evlist, evsel) evsel__copy_prev_raw_counts(evsel);
} | [
0,
0
] |
Linux Kernel | tools/perf/util/stat.c |
static size_t pkg_id_hash(long __key, void *ctx __maybe_unused) {
uint64_t *key = (uint64_t *)__key;
return *key & 0xffffffff;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/stat.c |
int perf_event__process_stat_event(struct perf_session *session,
union perf_event *event) {
struct perf_counts_values count, *ptr;
struct perf_record_stat *st = &event->stat;
struct evsel *counter;
int cpu_map_idx;
count.val = st->val;
count.ena = st->ena;
count.run = ... | [
0,
0
] |
Linux Kernel | tools/perf/util/stat.c |
size_t perf_event__fprintf_stat(union perf_event *event, FILE *fp) {
struct perf_record_stat *st = (struct perf_record_stat *)event;
size_t ret;
ret = fprintf(fp, "\n... id %" PRI_lu64 ", cpu %d, thread %d\n", st->id,
st->cpu, st->thread);
ret += fprintf(fp,
"... value %" PRI_... | [
1,
0
] |
Linux Kernel | tools/perf/util/stat.c |
size_t perf_event__fprintf_stat_config(union perf_event *event, FILE *fp) {
struct perf_stat_config sc;
size_t ret;
perf_event__read_stat_config(&sc, &event->stat_config);
ret = fprintf(fp, "\n");
ret += fprintf(fp, "... aggr_mode %d\n", sc.aggr_mode);
ret += fprintf(fp, "... scale %d\n", sc.scale);
... | [
0,
0
] |
Linux Kernel | tools/perf/util/stat.c | int create_perf_stat_counter(struct evsel *evsel,
struct perf_stat_config *config,
struct target *target, int cpu_map_idx) {
struct perf_event_attr *attr = &evsel->core.attr;
struct evsel *leader = evsel__leader(evsel);
attr->read_format =
PERF_FORM... | [
0,
0
] |
Linux Kernel | tools/perf/util/stat.h |
static inline void init_stats(struct stats *stats) {
stats->n = 0.0;
stats->mean = 0.0;
stats->M2 = 0.0;
stats->min = (u64)-1;
stats->max = 0;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/stat.h |
static inline void update_rusage_stats(struct rusage_stats *ru_stats,
struct rusage *rusage) {
const u64 us_to_ns = 1000;
const u64 s_to_ns = 1000000000;
update_stats(&ru_stats->ru_utime_usec_stat,
(rusage->ru_utime.tv_usec * us_to_ns +
rusage... | [
1,
0
] |
Linux Kernel | tools/perf/util/strbuf.c |
int strbuf_init(struct strbuf *sb, ssize_t hint) {
sb->alloc = sb->len = 0;
sb->buf = strbuf_slopbuf;
if (hint)
return strbuf_grow(sb, hint);
return 0;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/strbuf.c |
int strbuf_addch(struct strbuf *sb, int c) {
int ret = strbuf_grow(sb, 1);
if (ret)
return ret;
sb->buf[sb->len++] = c;
sb->buf[sb->len] = '\0';
return 0;
} | [
1,
0
] |
Linux Kernel | tools/perf/util/strbuf.c |
int strbuf_addf(struct strbuf *sb, const char *fmt, ...) {
va_list ap;
int ret;
va_start(ap, fmt);
ret = strbuf_addv(sb, fmt, ap);
va_end(ap);
return ret;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/strbuf.h | static inline int strbuf_addstr(struct strbuf *sb, const char *s) {
return strbuf_add(sb, s, strlen(s));
} | [
0,
0
] |
Linux Kernel | tools/perf/util/stream.c | static void evsel_streams__set_hot_cnode(struct evsel_streams *es,
struct callchain_node *cnode) {
int i, idx = 0;
u64 hit;
if (es->nr_streams < es->nr_streams_max) {
i = es->nr_streams;
es->streams[i].cnode = cnode;
es->nr_streams++;
return;
}
hit = ... | [
1,
0
] |
Linux Kernel | tools/perf/util/stream.c |
struct evlist_streams *evlist__create_streams(struct evlist *evlist,
int nr_streams_max) {
int nr_evsel = evlist->core.nr_entries, ret = -1;
struct evlist_streams *els = evlist_streams__new(nr_evsel, nr_streams_max);
if (!els)
return NULL;
ret = evlist__init_... | [
0,
0
] |
Linux Kernel | tools/perf/util/stream.c |
struct evsel_streams *evsel_streams__entry(struct evlist_streams *els,
int evsel_idx) {
struct evsel_streams *es = els->ev_streams;
for (int i = 0; i < els->nr_evsel; i++) {
if (es[i].evsel_idx == evsel_idx)
return &es[i];
}
return NULL;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/stream.c |
static void callchain_streams_report(struct evsel_streams *es_base,
struct evsel_streams *es_pair) {
struct stream *base_stream;
int i, idx = 0;
printf("[ Matched hot streams ]\n");
for (i = 0; i < es_base->nr_streams; i++) {
base_stream = &es_base->streams[i];
if ... | [
0,
0
] |
Linux Kernel | tools/perf/util/stream.c |
void evsel_streams__report(struct evsel_streams *es_base,
struct evsel_streams *es_pair) {
return callchain_streams_report(es_base, es_pair);
} | [
0,
0
] |
Linux Kernel | tools/perf/util/strfilter.c |
void strfilter__delete(struct strfilter *filter) {
if (filter) {
strfilter_node__delete(filter->root);
free(filter);
}
} | [
1,
0
] |
Linux Kernel | tools/perf/util/strfilter.c |
static struct strfilter_node *strfilter_node__alloc(const char *op,
struct strfilter_node *l,
struct strfilter_node *r) {
struct strfilter_node *node = zalloc(sizeof(*node));
if (node) {
node->p = op;
n... | [
0,
0
] |
Linux Kernel | tools/perf/util/strfilter.c |
static int strfilter__append(struct strfilter *filter, bool _or,
const char *rules, const char **err) {
struct strfilter_node *right, *root;
const char *ep = NULL;
if (!filter || !rules)
return -EINVAL;
right = strfilter_node__new(rules, &ep);
if (!right || *ep != '\0') {
... | [
0,
0
] |
Linux Kernel | tools/perf/util/strfilter.c |
int strfilter__or(struct strfilter *filter, const char *rules,
const char **err) {
return strfilter__append(filter, true, rules, err);
} | [
0,
0
] |
Linux Kernel | tools/perf/util/strfilter.c | bool strfilter__compare(struct strfilter *filter, const char *str) {
if (!filter)
return false;
return strfilter_node__compare(filter->root, str);
} | [
0,
0
] |
Linux Kernel | tools/perf/util/strfilter.c |
char *strfilter__string(struct strfilter *filter) {
int len;
char *ret = NULL;
len = strfilter_node__sprint(filter->root, NULL);
if (len < 0)
return NULL;
ret = malloc(len + 1);
if (ret)
strfilter_node__sprint(filter->root, ret);
return ret;
} | [
1,
0
] |
Linux Kernel | tools/perf/util/string.c | bool strlazymatch(const char *str, const char *pat) {
return __match_glob(str, pat, true, false);
} | [
0,
0
] |
Linux Kernel | tools/perf/util/string.c | char *asprintf_expr_inout_ints(const char *var, bool in, size_t nints,
int *ints) {
/*
* FIXME: replace this with an expression using log10() when we
* find a suitable implementation, maybe the one in the dvb drivers...
*
* "%s == %d || " = log10(MAXINT) * 2 + 8 chars for th... | [
1,
1
] |
Linux Kernel | tools/perf/util/string.c | char *strdup_esc(const char *str) {
char *s, *d, *p, *ret = strdup(str);
if (!ret)
return NULL;
d = strchr(ret, '\\');
if (!d)
return ret;
s = d + 1;
do {
if (*s == '\0') {
*d = '\0';
break;
}
p = strchr(s + 1, '\\');
if (p) {
memmove(d, s, p - s);
d += p -... | [
1,
0
] |
Linux Kernel | tools/perf/util/strlist.c |
int strlist__add(struct strlist *slist, const char *new_entry) {
return rblist__add_node(&slist->rblist, new_entry);
} | [
0,
0
] |
Linux Kernel | tools/perf/util/strlist.c |
void strlist__remove(struct strlist *slist, struct str_node *snode) {
rblist__remove_node(&slist->rblist, &snode->rb_node);
} | [
0,
0
] |
Linux Kernel | tools/perf/util/strlist.c |
static int strlist__parse_list_entry(struct strlist *slist, const char *s,
const char *subst_dir) {
int err;
char *subst = NULL;
if (strncmp(s, "file://", 7) == 0)
return strlist__load(slist, s + 7);
if (subst_dir) {
err = -ENOMEM;
if (asprintf(&subst, "%s/%s"... | [
1,
0
] |
Linux Kernel | tools/perf/util/svghelper.c |
static double cpu2y(int cpu) {
if (topology_map)
return cpu2slot(topology_map[cpu]) * SLOT_MULT;
else
return cpu2slot(cpu) * SLOT_MULT;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/svghelper.c | static double round_text_size(double size) {
int loop = 100;
double target = 10.0;
if (size >= 10.0)
return size;
while (loop--) {
if (size >= target)
return target;
target = target / 2.0;
}
return size;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/svghelper.c |
void svg_ubox(int Yslot, u64 start, u64 end, double height, const char *type,
int fd, int err, int merges) {
double w = time2pixels(end) - time2pixels(start);
height = normalize_height(height);
if (!svgfile)
return;
fprintf(svgfile, "<g>\n");
fprintf(svgfile, "<title>fd=%d error=%d merges... | [
1,
0
] |
Linux Kernel | tools/perf/util/svghelper.c | void svg_blocked(int Yslot, int cpu, u64 start, u64 end,
const char *backtrace) {
if (!svgfile)
return;
fprintf(svgfile, "<g>\n");
fprintf(svgfile, "<title>#%d blocked %s</title>\n", cpu,
time_to_string(end - start));
if (backtrace)
fprintf(svgfile, "<desc>Blocked on:\n%s</de... | [
1,
0
] |
Linux Kernel | tools/perf/util/svghelper.c |
void svg_running(int Yslot, int cpu, u64 start, u64 end,
const char *backtrace) {
double text_size;
const char *type;
if (!svgfile)
return;
if (svg_highlight && end - start > svg_highlight)
type = "sample_hi";
else
type = "sample";
fprintf(svgfile, "<g>\n");
fprintf(svgfil... | [
1,
0
] |
Linux Kernel | tools/perf/util/svghelper.c |
void svg_process(int cpu, u64 start, u64 end, int pid, const char *name,
const char *backtrace) {
double width;
const char *type;
if (!svgfile)
return;
if (svg_highlight && end - start >= svg_highlight)
type = "sample_hi";
else if (svg_highlight_name && strstr(name, svg_highlight_n... | [
1,
0
] |
Linux Kernel | tools/perf/util/svghelper.c |
void svg_wakeline(u64 start, int row1, int row2, const char *backtrace) {
double height;
if (!svgfile)
return;
fprintf(svgfile, "<g>\n");
if (backtrace)
fprintf(svgfile, "<desc>%s</desc>\n", backtrace);
if (row1 < row2)
fprintf(svgfile,
"<line x1=\"%.8f\" y1=\"%.2f\" x2=\"%.8f\" y... | [
1,
0
] |
Linux Kernel | tools/perf/util/svghelper.c |
void svg_text(int Yslot, u64 start, const char *text) {
if (!svgfile)
return;
fprintf(svgfile, "<text x=\"%.8f\" y=\"%.8f\">%s</text>\n",
time2pixels(start), Yslot * SLOT_MULT + SLOT_HEIGHT / 2, text);
} | [
1,
0
] |
Linux Kernel | tools/perf/util/svghelper.c |
void svg_io_legenda(void) {
if (!svgfile)
return;
fprintf(svgfile, "<g>\n");
svg_legenda_box(0, "Disk", "disk");
svg_legenda_box(100, "Network", "net");
svg_legenda_box(200, "Sync", "sync");
svg_legenda_box(300, "Poll", "poll");
svg_legenda_box(400, "Error", "error");
fprintf(svgfile, "</g>\n");
} | [
1,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.