Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | tools/perf/util/header.c |
int perf_event__process_build_id(struct perf_session *session,
union perf_event *event) {
__event_process_build_id(&event->build_id, event->build_id.filename, session);
return 0;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/hisi-ptt-decoder/hisi-ptt-pkt-decoder.c |
static int hisi_ptt_4dw_kpt_desc(const unsigned char *buf, int pos) {
int i;
hisi_ptt_4dw_print_dw0(buf, pos);
pos += HISI_PTT_FIELD_LENTH;
for (i = 0; i < HISI_PTT_4DW_TYPE_MAX; i++) {
hisi_ptt_print_pkt(buf, pos, hisi_ptt_4dw_pkt_field_name[i]);
pos += HISI_PTT_FIELD_LENTH;
}
return hisi_ptt_p... | [
0,
0
] |
Linux Kernel | tools/perf/util/hisi-ptt-decoder/hisi-ptt-pkt-decoder.c |
int hisi_ptt_pkt_desc(const unsigned char *buf, int pos,
enum hisi_ptt_pkt_type type) {
if (type == HISI_PTT_8DW_PKT)
return hisi_ptt_8dw_kpt_desc(buf, pos);
return hisi_ptt_4dw_kpt_desc(buf, pos);
} | [
0,
0
] |
Linux Kernel | tools/perf/util/hisi-ptt.c |
static int
hisi_ptt_process_auxtrace_event(struct perf_session *session,
union perf_event *event,
struct perf_tool *tool __maybe_unused) {
struct hisi_ptt *ptt =
container_of(session->auxtrace, struct hisi_ptt, auxtrace);
int fd = perf_data__fd(... | [
1,
0
] |
Linux Kernel | tools/perf/util/hist.c |
void hists__set_col_len(struct hists *hists, enum hist_column col, u16 len) {
hists->col_len[col] = len;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/hist.c |
void hists__reset_col_len(struct hists *hists) {
enum hist_column col;
for (col = 0; col < HISTC_NR_COLS; ++col)
hists__set_col_len(hists, col, 0);
} | [
0,
0
] |
Linux Kernel | tools/perf/util/hist.c |
static bool hists__decay_entry(struct hists *hists, struct hist_entry *he) {
u64 prev_period = he->stat.period;
u64 diff;
if (prev_period == 0)
return true;
he_stat__decay(&he->stat);
if (symbol_conf.cumulate_callchain)
he_stat__decay(he->stat_acc);
decay_callchain(he->callchain);
diff = prev_... | [
0,
0
] |
Linux Kernel | tools/perf/util/hist.c |
static void *hist_entry__zalloc(size_t size) {
return zalloc(size + sizeof(struct hist_entry));
} | [
1,
0
] |
Linux Kernel | tools/perf/util/hist.c |
static u8 symbol__parent_filter(const struct symbol *parent) {
if (symbol_conf.exclude_other && parent == NULL)
return 1 << HIST_FILTER__PARENT;
return 0;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/hist.c |
struct hist_entry *
hists__add_entry_ops(struct hists *hists, struct hist_entry_ops *ops,
struct addr_location *al, struct symbol *sym_parent,
struct branch_info *bi, struct mem_info *mi,
struct perf_sample *sample, bool sample_self) {
return __hists__ad... | [
0,
0
] |
Linux Kernel | tools/perf/util/hist.c |
static int iter_add_next_nop_entry(struct hist_entry_iter *iter __maybe_unused,
struct addr_location *al __maybe_unused) {
return 0;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/hist.c |
static int iter_prepare_mem_entry(struct hist_entry_iter *iter,
struct addr_location *al) {
struct perf_sample *sample = iter->sample;
struct mem_info *mi;
mi = sample__resolve_mem(sample, al);
if (mi == NULL)
return -ENOMEM;
iter->priv = mi;
return 0;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/hist.c | static int iter_add_single_mem_entry(struct hist_entry_iter *iter,
struct addr_location *al) {
u64 cost;
struct mem_info *mi = iter->priv;
struct hists *hists = evsel__hists(iter->evsel);
struct perf_sample *sample = iter->sample;
struct hist_entry *he;
if (mi == NULL)
... | [
0,
0
] |
Linux Kernel | tools/perf/util/hist.c |
static int
iter_add_single_branch_entry(struct hist_entry_iter *iter __maybe_unused,
struct addr_location *al __maybe_unused) {
return 0;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/hist.c |
static int
iter_prepare_normal_entry(struct hist_entry_iter *iter __maybe_unused,
struct addr_location *al __maybe_unused) {
return 0;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/hist.c | static int
iter_prepare_cumulative_entry(struct hist_entry_iter *iter,
struct addr_location *al __maybe_unused) {
struct hist_entry **he_cache;
callchain_cursor_commit(&callchain_cursor);
he_cache = malloc(sizeof(*he_cache) * (callchain_cursor.nr + 1));
if (he_cache == NULL)
... | [
1,
0
] |
Linux Kernel | tools/perf/util/hist.c |
static int
iter_finish_cumulative_entry(struct hist_entry_iter *iter,
struct addr_location *al __maybe_unused) {
zfree(&iter->priv);
iter->he = NULL;
return 0;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/hist.c |
int64_t hist_entry__cmp(struct hist_entry *left, struct hist_entry *right) {
struct hists *hists = left->hists;
struct perf_hpp_fmt *fmt;
int64_t cmp = 0;
hists__for_each_sort_list(hists, fmt) {
if (perf_hpp__is_dynamic_entry(fmt) &&
!perf_hpp__defined_dynamic_entry(fmt, hists))
continue;
... | [
0,
0
] |
Linux Kernel | tools/perf/util/hist.c | static struct hist_entry *
hierarchy_insert_entry(struct hists *hists, struct rb_root_cached *root,
struct hist_entry *he, struct hist_entry *parent_he,
struct perf_hpp_list *hpp_list) {
struct rb_node **p = &root->rb_root.rb_node;
struct rb_node *parent = NULL;
struc... | [
0,
0
] |
Linux Kernel | tools/perf/util/hist.c | int hists__collapse_resort(struct hists *hists, struct ui_progress *prog) {
struct rb_root_cached *root;
struct rb_node *next;
struct hist_entry *n;
int ret;
if (!hists__has(hists, need_collapse))
return 0;
hists->nr_entries = 0;
root = hists__get_rotate_entries_in(hists);
next = rb_first_cached... | [
0,
0
] |
Linux Kernel | tools/perf/util/hist.c |
static void hists__reset_filter_stats(struct hists *hists) {
hists->nr_non_filtered_entries = 0;
hists->stats.total_non_filtered_period = 0;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/hist.c |
void hists__reset_stats(struct hists *hists) {
hists->nr_entries = 0;
hists->stats.total_period = 0;
hists__reset_filter_stats(hists);
} | [
0,
0
] |
Linux Kernel | tools/perf/util/hist.c |
static void hists__hierarchy_output_resort(struct hists *hists,
struct ui_progress *prog,
struct rb_root_cached *root_in,
struct rb_root_cached *root_out,
... | [
0,
0
] |
Linux Kernel | tools/perf/util/hist.c | static void __hists__insert_output_entry(struct rb_root_cached *entries,
struct hist_entry *he,
u64 min_callchain_hits,
bool use_callchain) {
struct rb_node **p = &entries->rb_root.rb_node;
str... | [
0,
0
] |
Linux Kernel | tools/perf/util/hist.c |
static bool hists__filter_entry_by_dso(struct hists *hists,
struct hist_entry *he) {
if (hists->dso_filter != NULL &&
(he->ms.map == NULL || he->ms.map->dso != hists->dso_filter)) {
he->filtered |= (1 << HIST_FILTER__DSO);
return true;
}
return false;
} | [
1,
0
] |
Linux Kernel | tools/perf/util/hist.c |
static void hists__filter_by_type(struct hists *hists, int type,
filter_fn_t filter) {
struct rb_node *nd;
hists->stats.nr_non_filtered_samples = 0;
hists__reset_filter_stats(hists);
hists__reset_col_len(hists);
for (nd = rb_first_cached(&hists->entries); nd; nd = rb_next... | [
0,
0
] |
Linux Kernel | tools/perf/util/hist.c |
static void resort_filtered_entry(struct rb_root_cached *root,
struct hist_entry *he) {
struct rb_node **p = &root->rb_root.rb_node;
struct rb_node *parent = NULL;
struct hist_entry *iter;
struct rb_root_cached new_root = RB_ROOT_CACHED;
struct rb_node *nd;
bool leftmost =... | [
1,
0
] |
Linux Kernel | tools/perf/util/hist.c | static void hists__filter_hierarchy(struct hists *hists, int type,
const void *arg) {
struct rb_node *nd;
struct rb_root_cached new_root = RB_ROOT_CACHED;
hists->stats.nr_non_filtered_samples = 0;
hists__reset_filter_stats(hists);
hists__reset_col_len(hists);
nd = rb_f... | [
1,
0
] |
Linux Kernel | tools/perf/util/hist.c |
void hists__filter_by_thread(struct hists *hists) {
if (symbol_conf.report_hierarchy)
hists__filter_hierarchy(hists, HIST_FILTER__THREAD, hists->thread_filter);
else
hists__filter_by_type(hists, HIST_FILTER__THREAD,
hists__filter_entry_by_thread);
} | [
0,
0
] |
Linux Kernel | tools/perf/util/hist.c |
void events_stats__inc(struct events_stats *stats, u32 type) {
++stats->nr_events[0];
++stats->nr_events[type];
} | [
1,
0
] |
Linux Kernel | tools/perf/util/hist.c |
static void hists_stats__inc(struct hists_stats *stats) { ++stats->nr_samples; } | [
1,
0
] |
Linux Kernel | tools/perf/util/hist.c |
void hists__inc_nr_samples(struct hists *hists, bool filtered) {
hists_stats__inc(&hists->stats);
if (!filtered)
hists->stats.nr_non_filtered_samples++;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/hist.c |
static struct hist_entry *hists__add_dummy_entry(struct hists *hists,
struct hist_entry *pair) {
struct rb_root_cached *root;
struct rb_node **p;
struct rb_node *parent = NULL;
struct hist_entry *he;
int64_t cmp;
bool leftmost = true;
if (hists__has(hists... | [
1,
0
] |
Linux Kernel | tools/perf/util/hist.c |
int hists__unlink(struct hists *hists) {
struct rb_root_cached *root;
struct rb_node *nd;
struct hist_entry *pos;
if (hists__has(hists, need_collapse))
root = &hists->entries_collapsed;
else
root = hists->entries_in;
for (nd = rb_first_cached(root); nd; nd = rb_next(nd)) {
pos = rb_entry(nd, ... | [
0,
0
] |
Linux Kernel | tools/perf/util/hist.c | void hist__account_cycles(struct branch_stack *bs, struct addr_location *al,
struct perf_sample *sample, bool nonany_branch_mode,
u64 *total_cycles) {
struct branch_info *bi;
struct branch_entry *entries = perf_sample__branch_entries(sample);
if (bs && bs->nr &... | [
1,
0
] |
Linux Kernel | tools/perf/util/hist.c |
size_t evlist__fprintf_nr_events(struct evlist *evlist, FILE *fp,
bool skip_empty) {
struct evsel *pos;
size_t ret = 0;
evlist__for_each_entry(evlist, pos) {
struct hists *hists = evsel__hists(pos);
if (skip_empty && !hists->stats.nr_samples && !hists->stats.nr_lost_sam... | [
0,
0
] |
Linux Kernel | tools/perf/util/hist.c |
int perf_hist_config(const char *var, const char *value) {
if (!strcmp(var, "hist.percentage"))
return parse_filter_percentage(NULL, value, 0);
return 0;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/hist.c |
int __hists__init(struct hists *hists, struct perf_hpp_list *hpp_list) {
memset(hists, 0, sizeof(*hists));
hists->entries_in_array[0] = hists->entries_in_array[1] = RB_ROOT_CACHED;
hists->entries_in = &hists->entries_in_array[0];
hists->entries_collapsed = RB_ROOT_CACHED;
hists->entries = RB_ROOT_CACHED;
m... | [
1,
0
] |
Linux Kernel | tools/perf/util/hist.c |
static void hists__delete_remaining_entries(struct rb_root_cached *root) {
struct rb_node *node;
struct hist_entry *he;
while (!RB_EMPTY_ROOT(&root->rb_root)) {
node = rb_first_cached(root);
rb_erase_cached(node, root);
he = rb_entry(node, struct hist_entry, rb_node_in);
hist_entry__delete(he);... | [
0,
0
] |
Linux Kernel | tools/perf/util/hist.h |
static inline void perf_hpp__column_register(struct perf_hpp_fmt *format) {
perf_hpp_list__column_register(&perf_hpp_list, format);
} | [
0,
0
] |
Linux Kernel | tools/perf/util/hist.h | static inline int map_symbol__tui_annotate(
struct map_symbol *ms __maybe_unused, struct evsel *evsel __maybe_unused,
struct hist_browser_timer *hbt __maybe_unused,
struct annotation_options *annotation_options __maybe_unused) {
return 0;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/hist.h |
static inline int hist_entry__tui_annotate(
struct hist_entry *he __maybe_unused, struct evsel *evsel __maybe_unused,
struct hist_browser_timer *hbt __maybe_unused,
struct annotation_options *annotation_opts __maybe_unused) {
return 0;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/intel-bts.c |
static void intel_bts_dump_event(struct intel_bts *bts, unsigned char *buf,
size_t len) {
printf(".\n");
intel_bts_dump(bts, buf, len);
} | [
0,
0
] |
Linux Kernel | tools/perf/util/intel-bts.c |
static int intel_bts_setup_queue(struct intel_bts *bts,
struct auxtrace_queue *queue,
unsigned int queue_nr) {
struct intel_bts_queue *btsq = queue->priv;
if (list_empty(&queue->head))
return 0;
if (!btsq) {
btsq = intel_bts_alloc_queue(... | [
1,
0
] |
Linux Kernel | tools/perf/util/intel-bts.c |
static int intel_bts_setup_queues(struct intel_bts *bts) {
unsigned int i;
int ret;
for (i = 0; i < bts->queues.nr_queues; i++) {
ret = intel_bts_setup_queue(bts, &bts->queues.queue_array[i], i);
if (ret)
return ret;
}
return 0;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/intel-bts.c |
static int intel_bts_synth_branch_sample(struct intel_bts_queue *btsq,
struct branch *branch) {
int ret;
struct intel_bts *bts = btsq->bts;
union perf_event event;
struct perf_sample sample = {
.ip = 0,
};
if (bts->synth_opts.initial_skip &&
bts->num_ev... | [
1,
0
] |
Linux Kernel | tools/perf/util/intel-bts.c |
static int intel_bts_synth_error(struct intel_bts *bts, int cpu, pid_t pid,
pid_t tid, u64 ip) {
union perf_event event;
int err;
auxtrace_synth_error(&event.auxtrace_error, PERF_AUXTRACE_ERROR_ITRACE,
INTEL_BTS_ERR_NOINSN, cpu, pid, tid, ip,
... | [
0,
0
] |
Linux Kernel | tools/perf/util/intel-bts.c |
static int intel_bts_process_buffer(struct intel_bts_queue *btsq,
struct auxtrace_buffer *buffer,
struct thread *thread) {
struct branch *branch;
size_t sz, bsz = sizeof(struct branch);
u32 filter = btsq->bts->branches_filter;
int err = 0;... | [
1,
0
] |
Linux Kernel | tools/perf/util/intel-bts.c |
static int intel_bts_process_tid_exit(struct intel_bts *bts, pid_t tid) {
struct auxtrace_queues *queues = &bts->queues;
unsigned int i;
for (i = 0; i < queues->nr_queues; i++) {
struct auxtrace_queue *queue = &bts->queues.queue_array[i];
struct intel_bts_queue *btsq = queue->priv;
if (btsq && btsq... | [
1,
0
] |
Linux Kernel | tools/perf/util/intel-bts.c |
static void intel_bts_free_events(struct perf_session *session) {
struct intel_bts *bts =
container_of(session->auxtrace, struct intel_bts, auxtrace);
struct auxtrace_queues *queues = &bts->queues;
unsigned int i;
for (i = 0; i < queues->nr_queues; i++) {
intel_bts_free_queue(queues->queue_array[i].... | [
0,
0
] |
Linux Kernel | tools/perf/util/intel-bts.c |
static void intel_bts_free(struct perf_session *session) {
struct intel_bts *bts =
container_of(session->auxtrace, struct intel_bts, auxtrace);
auxtrace_heap__free(&bts->heap);
intel_bts_free_events(session);
session->auxtrace = NULL;
free(bts);
} | [
1,
0
] |
Linux Kernel | tools/perf/util/intel-pt-decoder/intel-pt-decoder.c |
static void intel_pt_setup_period(struct intel_pt_decoder *decoder) {
if (decoder->period_type == INTEL_PT_PERIOD_TICKS) {
uint64_t period;
period = intel_pt_lower_power_of_2(decoder->period);
decoder->period_mask = ~(period - 1);
decoder->period_ticks = period;
}
} | [
0,
0
] |
Linux Kernel | tools/perf/util/intel-pt-decoder/intel-pt-decoder.c |
void intel_pt_set_first_timestamp(struct intel_pt_decoder *decoder,
uint64_t first_timestamp) {
decoder->first_timestamp = first_timestamp;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/intel-pt-decoder/intel-pt-decoder.c |
static int intel_pt_alloc_blk(struct intel_pt_stack *stack) {
struct intel_pt_blk *blk;
if (stack->spare) {
blk = stack->spare;
stack->spare = NULL;
} else {
blk = malloc(sizeof(struct intel_pt_blk));
if (!blk)
return -ENOMEM;
}
blk->prev = stack->blk;
stack->blk = blk;
stack->pos... | [
1,
0
] |
Linux Kernel | tools/perf/util/intel-pt-decoder/intel-pt-decoder.c |
static int intel_pt_ext_err(int code) {
switch (code) {
case -ENOMEM:
return INTEL_PT_ERR_NOMEM;
case -ENOSYS:
return INTEL_PT_ERR_INTERN;
case -EBADMSG:
return INTEL_PT_ERR_BADPKT;
case -ENODATA:
return INTEL_PT_ERR_NODATA;
case -EILSEQ:
return INTEL_PT_ERR_NOINSN;
case -ENOENT:
... | [
0,
0
] |
Linux Kernel | tools/perf/util/intel-pt-decoder/intel-pt-decoder.c | static uint64_t intel_pt_calc_ip(const struct intel_pt_pkt *packet,
uint64_t last_ip) {
uint64_t ip;
switch (packet->count) {
case 1:
ip = (last_ip & (uint64_t)0xffffffffffff0000ULL) | packet->payload;
break;
case 2:
ip = (last_ip & (uint64_t)0xffffffff00000000ULL) ... | [
1,
0
] |
Linux Kernel | tools/perf/util/intel-pt-decoder/intel-pt-decoder.c |
static inline void intel_pt_update_in_tx(struct intel_pt_decoder *decoder) {
decoder->tx_flags = decoder->packet.payload & INTEL_PT_IN_TX;
} | [
1,
0
] |
Linux Kernel | tools/perf/util/intel-pt-decoder/intel-pt-decoder.c |
static inline void intel_pt_update_pip(struct intel_pt_decoder *decoder) {
decoder->pip_payload = decoder->packet.payload;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/intel-pt-decoder/intel-pt-decoder.c |
static inline void intel_pt_set_nr(struct intel_pt_decoder *decoder) {
decoder->nr = decoder->pip_payload & 1;
decoder->next_nr = decoder->nr;
} | [
1,
0
] |
Linux Kernel | tools/perf/util/intel-pt-decoder/intel-pt-decoder.c |
static inline void
intel_pt_update_sample_time(struct intel_pt_decoder *decoder) {
decoder->sample_timestamp = decoder->timestamp;
decoder->sample_insn_cnt = decoder->timestamp_insn_cnt;
decoder->state.cycles = decoder->tot_cyc_cnt;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/intel-pt-decoder/intel-pt-decoder.c |
static void intel_pt_reposition(struct intel_pt_decoder *decoder) {
decoder->ip = 0;
decoder->pkt_state = INTEL_PT_STATE_NO_PSB;
decoder->timestamp = 0;
decoder->have_tma = false;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/intel-pt-decoder/intel-pt-decoder.c |
static int intel_pt_get_data(struct intel_pt_decoder *decoder,
bool reposition) {
struct intel_pt_buffer buffer = {
.buf = 0,
};
int ret;
decoder->pkt_step = 0;
intel_pt_log("Getting more data\n");
ret = decoder->get_trace(&buffer, decoder->data);
if (ret)
return ... | [
0,
0
] |
Linux Kernel | tools/perf/util/intel-pt-decoder/intel-pt-decoder.c | static void intel_pt_fixup_last_mtc(uint32_t mtc, int mtc_shift,
uint32_t *last_mtc) {
uint32_t first_missing_bit = 1U << (16 - mtc_shift);
uint32_t mask = ~(first_missing_bit - 1);
*last_mtc |= mtc & mask;
if (*last_mtc >= mtc) {
*last_mtc -= first_missing_bit;
*las... | [
1,
0
] |
Linux Kernel | tools/perf/util/intel-pt-decoder/intel-pt-decoder.c | static void intel_pt_calc_cyc_to_tsc(struct intel_pt_decoder *decoder,
bool from_mtc) {
struct intel_pt_calc_cyc_to_tsc_info data = {
.cycle_cnt = 0,
.cbr = 0,
.last_mtc = decoder->last_mtc,
.ctc_timestamp = decoder->ctc_timestamp,
.ctc_delta = decode... | [
0,
0
] |
Linux Kernel | tools/perf/util/intel-pt-decoder/intel-pt-decoder.c | static void intel_pt_sample_fup_insn(struct intel_pt_decoder *decoder) {
struct intel_pt_insn intel_pt_insn;
uint64_t max_insn_cnt, insn_cnt = 0;
int err;
decoder->state.insn_op = INTEL_PT_OP_OTHER;
decoder->state.insn_len = 0;
if (!decoder->branch_enable || !decoder->pge || decoder->hop ||
decoder-... | [
1,
0
] |
Linux Kernel | tools/perf/util/intel-pt-decoder/intel-pt-decoder.c |
static void intel_pt_sample_iflag(struct intel_pt_decoder *decoder) {
decoder->state.type |= INTEL_PT_IFLAG_CHG;
decoder->state.from_iflag = decoder->iflag;
decoder->state.to_iflag = decoder->next_iflag;
decoder->iflag = decoder->next_iflag;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/intel-pt-decoder/intel-pt-decoder.c |
static int intel_pt_eptw_lookahead_cb(struct intel_pt_pkt_info *pkt_info) {
struct eptw_data *data = pkt_info->data;
int nr_bits;
switch (pkt_info->packet.type) {
case INTEL_PT_PAD:
case INTEL_PT_MNT:
case INTEL_PT_MODE_EXEC:
case INTEL_PT_MODE_TSX:
case INTEL_PT_MTC:
case INTEL_PT_FUP:
case INTEL... | [
1,
0
] |
Linux Kernel | tools/perf/util/intel-pt-decoder/intel-pt-decoder.c |
static int intel_pt_emulated_ptwrite(struct intel_pt_decoder *decoder) {
int n = 64 - decoder->tnt.count;
struct eptw_data data = {
.bit_countdown = n,
.payload = decoder->tnt.payload >> n,
};
decoder->emulated_ptwrite = false;
intel_pt_log("Emulated ptwrite detected\n");
intel_pt_pkt_lookahe... | [
0,
0
] |
Linux Kernel | tools/perf/util/intel-pt-decoder/intel-pt-decoder.c |
static int intel_pt_mode_tsx(struct intel_pt_decoder *decoder, bool *no_tip) {
unsigned int fup_tx_flags;
int err;
fup_tx_flags = decoder->packet.payload & (INTEL_PT_IN_TX | INTEL_PT_ABORT_TX);
err = intel_pt_get_next_packet(decoder);
if (err)
return err;
if (decoder->packet.type == INTEL_PT_FUP) {
... | [
0,
0
] |
Linux Kernel | tools/perf/util/intel-pt-decoder/intel-pt-decoder.c |
static uint64_t intel_pt_8b_tsc(uint64_t timestamp, uint64_t ref_timestamp) {
timestamp |= (ref_timestamp & (0xffULL << 56));
if (timestamp < ref_timestamp) {
if (ref_timestamp - timestamp > (1ULL << 55))
timestamp += (1ULL << 56);
} else {
if (timestamp - ref_timestamp > (1ULL << 55))
times... | [
0,
0
] |
Linux Kernel | tools/perf/util/intel-pt-decoder/intel-pt-decoder.c |
static inline void intel_pt_mtc_cyc_cnt_pge(struct intel_pt_decoder *decoder) {
if (decoder->have_cyc)
return;
decoder->cyc_cnt_timestamp = decoder->timestamp;
decoder->base_cyc_cnt = decoder->tot_cyc_cnt;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/intel-pt-decoder/intel-pt-decoder.c |
static inline void intel_pt_mtc_cyc_cnt_cbr(struct intel_pt_decoder *decoder) {
decoder->tsc_to_cyc = decoder->cbr / decoder->max_non_turbo_ratio_fp;
if (decoder->pge)
intel_pt_mtc_cyc_cnt_pge(decoder);
} | [
1,
0
] |
Linux Kernel | tools/perf/util/intel-pt-decoder/intel-pt-decoder.c |
static inline void intel_pt_mtc_cyc_cnt_upd(struct intel_pt_decoder *decoder) {
uint64_t tot_cyc_cnt, tsc_delta;
if (decoder->have_cyc)
return;
decoder->sample_cyc = true;
if (!decoder->pge || decoder->timestamp <= decoder->cyc_cnt_timestamp)
return;
tsc_delta = decoder->timestamp - decoder->cyc_... | [
1,
0
] |
Linux Kernel | tools/perf/util/intel-pt-decoder/intel-pt-decoder.c |
static void intel_pt_calc_mtc_timestamp(struct intel_pt_decoder *decoder) {
uint64_t timestamp;
uint32_t mtc, mtc_delta;
if (!decoder->have_tma)
return;
mtc = decoder->packet.payload;
if (decoder->mtc_shift > 8 && decoder->fixup_last_mtc) {
decoder->fixup_last_mtc = false;
intel_pt_fixup_last_... | [
1,
0
] |
Linux Kernel | tools/perf/util/intel-pt-decoder/intel-pt-decoder.c |
static void intel_pt_calc_cbr(struct intel_pt_decoder *decoder) {
unsigned int cbr = decoder->packet.payload & 0xff;
decoder->cbr_payload = decoder->packet.payload;
if (decoder->cbr == cbr)
return;
decoder->cbr = cbr;
decoder->cbr_cyc_to_tsc = decoder->max_non_turbo_ratio_fp / cbr;
intel_pt_mtc_cyc... | [
1,
0
] |
Linux Kernel | tools/perf/util/intel-pt-decoder/intel-pt-decoder.c |
static void intel_pt_bbp(struct intel_pt_decoder *decoder) {
if (decoder->prev_pkt_ctx == INTEL_PT_NO_CTX) {
memset(decoder->state.items.mask, 0, sizeof(decoder->state.items.mask));
decoder->state.items.is_32_bit = false;
}
decoder->blk_type = decoder->packet.payload;
decoder->blk_type_pos = intel_pt_b... | [
1,
0
] |
Linux Kernel | tools/perf/util/intel-pt-decoder/intel-pt-decoder.c | static int intel_pt_vm_psb_lookahead_cb(struct intel_pt_pkt_info *pkt_info) {
struct intel_pt_vm_tsc_info *data = pkt_info->data;
switch (pkt_info->packet.type) {
case INTEL_PT_PAD:
case INTEL_PT_MNT:
case INTEL_PT_MODE_EXEC:
case INTEL_PT_MODE_TSX:
case INTEL_PT_MTC:
case INTEL_PT_FUP:
case INTEL_PT... | [
0,
0
] |
Linux Kernel | tools/perf/util/intel-pt-decoder/intel-pt-decoder.c | static int intel_pt_ovf_fup_lookahead_cb(struct intel_pt_pkt_info *pkt_info) {
struct intel_pt_ovf_fup_info *data = pkt_info->data;
if (pkt_info->packet.type == INTEL_PT_CYC ||
pkt_info->packet.type == INTEL_PT_MTC ||
pkt_info->packet.type == INTEL_PT_TSC)
return !--(data->max_lookahead);
data->f... | [
1,
0
] |
Linux Kernel | tools/perf/util/intel-pt-decoder/intel-pt-decoder.c |
static uint64_t intel_pt_ctc_to_tsc(struct intel_pt_decoder *decoder,
uint64_t ctc) {
if (decoder->tsc_ctc_mult)
return ctc * decoder->tsc_ctc_mult;
else
return multdiv(ctc, decoder->tsc_ctc_ratio_n, decoder->tsc_ctc_ratio_d);
} | [
0,
0
] |
Linux Kernel | tools/perf/util/intel-pt-decoder/intel-pt-decoder.c | static void intel_pt_translate_vm_tsc(struct intel_pt_decoder *decoder,
struct intel_pt_vmcs_info *vmcs_info) {
uint64_t payload = decoder->packet.payload;
decoder->packet.payload -= vmcs_info->tsc_offset;
/* TSC packet has only 7 bytes */
decoder->packet.payload &= SEVEN_... | [
1,
0
] |
Linux Kernel | tools/perf/util/intel-pt-decoder/intel-pt-decoder.c |
static void intel_pt_vm_tm_corr_psb(struct intel_pt_decoder *decoder,
struct intel_pt_vm_tsc_info *data) {
memset(data, 0, sizeof(*data));
data->ctc_delta = decoder->ctc_delta;
data->last_ctc = decoder->last_ctc;
intel_pt_pkt_lookahead(decoder, intel_pt_vm_psb_lookahead_cb, ... | [
1,
0
] |
Linux Kernel | tools/perf/util/intel-pt-decoder/intel-pt-decoder.c |
static bool intel_pt_psb_with_fup(struct intel_pt_decoder *decoder, int *err) {
struct intel_pt_psb_info data = {.fup = false};
if (!decoder->branch_enable)
return false;
intel_pt_pkt_lookahead(decoder, intel_pt_psb_lookahead_cb, &data);
if (!data.fup)
return false;
decoder->packet = data.fup_pack... | [
0,
0
] |
Linux Kernel | tools/perf/util/intel-pt-decoder/intel-pt-decoder.c |
static int intel_pt_scan_for_psb(struct intel_pt_decoder *decoder) {
unsigned char *next;
int ret;
intel_pt_log("Scanning for PSB\n");
while (1) {
if (!decoder->len) {
ret = intel_pt_get_next_data(decoder, false);
if (ret)
return ret;
}
next =
memmem(decoder->buf, deco... | [
0,
0
] |
Linux Kernel | tools/perf/util/intel-pt-decoder/intel-pt-decoder.c |
static uint64_t intel_pt_est_timestamp(struct intel_pt_decoder *decoder) {
uint64_t est = decoder->sample_insn_cnt << 1;
if (!decoder->cbr || !decoder->max_non_turbo_ratio)
goto out;
est *= decoder->max_non_turbo_ratio;
est /= decoder->cbr;
out:
return decoder->sample_timestamp + est;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/intel-pt-decoder/intel-pt-decoder.c | static bool intel_pt_next_psb(unsigned char **buf, size_t *len) {
unsigned char *next;
next = memmem(*buf, *len, INTEL_PT_PSB_STR, INTEL_PT_PSB_LEN);
if (next) {
*len -= next - *buf;
*buf = next;
return true;
}
return false;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/intel-pt-decoder/intel-pt-decoder.c | static bool intel_pt_step_psb(unsigned char **buf, size_t *len) {
unsigned char *next;
if (!*len)
return false;
next = memmem(*buf + 1, *len - 1, INTEL_PT_PSB_STR, INTEL_PT_PSB_LEN);
if (next) {
*len -= next - *buf;
*buf = next;
return true;
}
return false;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/intel-pt-decoder/intel-pt-decoder.c | static int intel_pt_tsc_cmp(uint64_t tsc1, uint64_t tsc2) {
const uint64_t halfway = (1ULL << 55);
if (tsc1 == tsc2)
return 0;
if (tsc1 < tsc2) {
if (tsc2 - tsc1 < halfway)
return -1;
else
return 1;
} else {
if (tsc1 - tsc2 < halfway)
return 1;
else
return -1;
}
} | [
0,
0
] |
Linux Kernel | tools/perf/util/intel-pt-decoder/intel-pt-decoder.c | static unsigned char *adj_for_padding(unsigned char *buf_b,
unsigned char *buf_a, size_t len_a) {
unsigned char *p = buf_b - MAX_PADDING;
unsigned char *q = buf_a + len_a - MAX_PADDING;
int i;
for (i = MAX_PADDING; i; i--, p++, q++) {
if (*p != *q)
break;
}
... | [
1,
0
] |
Linux Kernel | tools/perf/util/intel-pt-decoder/intel-pt-decoder.c | static unsigned char *intel_pt_find_overlap_tsc(unsigned char *buf_a,
size_t len_a,
unsigned char *buf_b,
size_t len_b, bool *consecutive,
... | [
1,
0
] |
Linux Kernel | tools/perf/util/intel-pt-decoder/intel-pt-decoder.c | static int intel_pt_ff_cb(struct intel_pt_buffer *buffer, void *data) {
struct fast_forward_data *d = data;
unsigned char *buf;
uint64_t tsc;
size_t rem;
size_t len;
buf = (unsigned char *)buffer->buf;
len = buffer->len;
if (!intel_pt_next_psb(&buf, &len) ||
!intel_pt_next_tsc(buf, len, &tsc, &r... | [
0,
0
] |
Linux Kernel | tools/perf/util/intel-pt-decoder/intel-pt-insn-decoder.c |
int intel_pt_get_insn(const unsigned char *buf, size_t len, int x86_64,
struct intel_pt_insn *intel_pt_insn) {
struct insn insn;
int ret;
ret = insn_decode(&insn, buf, len, x86_64 ? INSN_MODE_64 : INSN_MODE_32);
if (ret < 0 || insn.length > len)
return -1;
intel_pt_insn_decoder(&i... | [
1,
0
] |
Linux Kernel | tools/perf/util/intel-pt-decoder/intel-pt-insn-decoder.c |
int intel_pt_insn_desc(const struct intel_pt_insn *intel_pt_insn, char *buf,
size_t buf_len) {
switch (intel_pt_insn->branch) {
case INTEL_PT_BR_CONDITIONAL:
case INTEL_PT_BR_UNCONDITIONAL:
return snprintf(buf, buf_len, "%s %s%d",
intel_pt_insn_name(intel_pt_insn->o... | [
0,
0
] |
Linux Kernel | tools/perf/util/intel-pt-decoder/intel-pt-log.c |
void intel_pt_log_enable(bool dump_log_on_error,
unsigned int log_on_error_size) {
intel_pt_enable_logging = true;
intel_pt_dump_log_on_error = dump_log_on_error;
intel_pt_log_on_error_size = log_on_error_size;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/intel-pt-decoder/intel-pt-log.c |
static ssize_t log_buf__write(void *cookie, const char *buf, size_t size) {
struct log_buf *b = cookie;
size_t sz = size;
if (!b->buf)
return size;
while (sz) {
size_t space = b->buf_sz - b->head;
size_t n = min(space, sz);
memcpy(b->buf + b->head, buf, n);
sz -= n;
buf += n;
b->... | [
1,
0
] |
Linux Kernel | tools/perf/util/intel-pt-decoder/intel-pt-log.c |
static int log_buf__close(void *cookie) {
struct log_buf *b = cookie;
zfree(&b->buf);
return 0;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/intel-pt-decoder/intel-pt-log.c |
static bool remove_first_line(const char **p, size_t *n) {
for (; *n && **p != '\n'; ++*p, --*n)
;
if (*n) {
*p += 1;
*n -= 1;
return true;
}
return false;
} | [
0,
0
] |
Linux Kernel | tools/perf/util/intel-pt-decoder/intel-pt-log.c |
static void write_lines(const char *p, size_t n, FILE *fp, bool *remove_first) {
if (*remove_first)
*remove_first = !remove_first_line(&p, &n);
fwrite(p, n, 1, fp);
} | [
0,
0
] |
Linux Kernel | tools/perf/util/intel-pt-decoder/intel-pt-log.c |
void __intel_pt_log_insn_no_data(struct intel_pt_insn *intel_pt_insn,
uint64_t ip) {
char desc[INTEL_PT_INSN_DESC_MAX];
if (intel_pt_log_open())
return;
intel_pt_print_no_data(ip, 8);
if (intel_pt_insn_desc(intel_pt_insn, desc, INTEL_PT_INSN_DESC_MAX) > 0)
fprintf(f, ... | [
0,
0
] |
Linux Kernel | tools/perf/util/intel-pt-decoder/intel-pt-log.h |
static inline void intel_pt_log_at(const char *msg, uint64_t u) {
intel_pt_log("%s at " x64_fmt "\n", msg, u);
} | [
0,
0
] |
Linux Kernel | tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c |
const char *intel_pt_pkt_name(enum intel_pt_pkt_type type) {
return packet_name[type];
} | [
0,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.