Making the namespace more uniform.
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Tom Zanussi <tzanussi@gmail.com>
LKML-Reference: <new-submission>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
return hist_entry__inc_addr_samples(he, al->addr);
}
-static int process_sample_event(event_t *event, struct sample_data *sample,
+static int process_sample_event(event_t *event, struct perf_sample *sample,
struct perf_session *session)
{
struct addr_location al;
}
static int diff__process_sample_event(event_t *event,
- struct sample_data *sample,
+ struct perf_sample *sample,
struct perf_session *session)
{
struct addr_location al;
return 0;
}
-static int event__repipe(event_t *event, struct sample_data *sample __used,
+static int event__repipe(event_t *event, struct perf_sample *sample __used,
struct perf_session *session)
{
return event__repipe_synth(event, session);
}
-static int event__repipe_mmap(event_t *self, struct sample_data *sample,
+static int event__repipe_mmap(event_t *self, struct perf_sample *sample,
struct perf_session *session)
{
int err;
return err;
}
-static int event__repipe_task(event_t *self, struct sample_data *sample,
+static int event__repipe_task(event_t *self, struct perf_sample *sample,
struct perf_session *session)
{
int err;
return 0;
}
-static int event__inject_buildid(event_t *event, struct sample_data *sample,
+static int event__inject_buildid(event_t *event, struct perf_sample *sample,
struct perf_session *session)
{
struct addr_location al;
}
}
-static int process_sample_event(event_t *event, struct sample_data *sample,
+static int process_sample_event(event_t *event, struct perf_sample *sample,
struct perf_session *session)
{
struct thread *thread = perf_session__findnew(session, event->ip.pid);
die("Unknown type of information\n");
}
-static int process_sample_event(event_t *self, struct sample_data *sample,
+static int process_sample_event(event_t *self, struct perf_sample *sample,
struct perf_session *s)
{
struct thread *thread = perf_session__findnew(s, sample->tid);
}
static int process_synthesized_event(event_t *event,
- struct sample_data *sample __used,
+ struct perf_sample *sample __used,
struct perf_session *self __used)
{
write_output(event, event->header.size);
return new;
}
-static int perf_session__add_hist_entry(struct perf_session *self,
+static int perf_session__add_hist_entry(struct perf_session *session,
struct addr_location *al,
- struct sample_data *data)
+ struct perf_sample *sample)
{
struct symbol *parent = NULL;
int err = 0;
struct hists *hists;
struct perf_event_attr *attr;
- if ((sort__has_parent || symbol_conf.use_callchain) && data->callchain) {
- err = perf_session__resolve_callchain(self, al->thread,
- data->callchain, &parent);
+ if ((sort__has_parent || symbol_conf.use_callchain) && sample->callchain) {
+ err = perf_session__resolve_callchain(session, al->thread,
+ sample->callchain, &parent);
if (err)
return err;
}
- attr = perf_header__find_attr(data->id, &self->header);
+ attr = perf_header__find_attr(sample->id, &session->header);
if (attr)
- hists = perf_session__hists_findnew(self, data->id, attr->type, attr->config);
+ hists = perf_session__hists_findnew(session, sample->id, attr->type, attr->config);
else
- hists = perf_session__hists_findnew(self, data->id, 0, 0);
+ hists = perf_session__hists_findnew(session, sample->id, 0, 0);
if (hists == NULL)
return -ENOMEM;
- he = __hists__add_entry(hists, al, parent, data->period);
+ he = __hists__add_entry(hists, al, parent, sample->period);
if (he == NULL)
return -ENOMEM;
if (symbol_conf.use_callchain) {
- err = callchain_append(he->callchain, &self->callchain_cursor,
- data->period);
+ err = callchain_append(he->callchain, &session->callchain_cursor,
+ sample->period);
if (err)
return err;
}
}
static int add_event_total(struct perf_session *session,
- struct sample_data *data,
+ struct perf_sample *sample,
struct perf_event_attr *attr)
{
struct hists *hists;
if (attr)
- hists = perf_session__hists_findnew(session, data->id,
+ hists = perf_session__hists_findnew(session, sample->id,
attr->type, attr->config);
else
- hists = perf_session__hists_findnew(session, data->id, 0, 0);
+ hists = perf_session__hists_findnew(session, sample->id, 0, 0);
if (!hists)
return -ENOMEM;
- hists->stats.total_period += data->period;
+ hists->stats.total_period += sample->period;
/*
* FIXME: add_event_total should be moved from here to
* perf_session__process_event so that the proper hist is passed to
* the event_op methods.
*/
hists__inc_nr_events(hists, PERF_RECORD_SAMPLE);
- session->hists.stats.total_period += data->period;
+ session->hists.stats.total_period += sample->period;
return 0;
}
-static int process_sample_event(event_t *event, struct sample_data *sample,
+static int process_sample_event(event_t *event, struct perf_sample *sample,
struct perf_session *session)
{
struct addr_location al;
return 0;
}
-static int process_read_event(event_t *event, struct sample_data *sample __used,
+static int process_read_event(event_t *event, struct perf_sample *sample __used,
struct perf_session *session __used)
{
struct perf_event_attr *attr;
process_sched_migrate_task_event(data, session, event, cpu, timestamp, thread);
}
-static int process_sample_event(event_t *event, struct sample_data *sample,
+static int process_sample_event(event_t *event, struct perf_sample *sample,
struct perf_session *session)
{
struct thread *thread;
static char const *input_name = "perf.data";
-static int process_sample_event(event_t *event, struct sample_data *sample,
+static int process_sample_event(event_t *event, struct perf_sample *sample,
struct perf_session *session)
{
struct thread *thread = perf_session__findnew(session, event->ip.pid);
}
while ((event = perf_evlist__read_on_cpu(evlist, 0)) != NULL) {
- struct sample_data sample;
+ struct perf_sample sample;
if (event->header.type != PERF_RECORD_SAMPLE) {
pr_debug("unexpected %s event\n",
static u64 cpus_pstate_start_times[MAX_CPUS];
static u64 cpus_pstate_state[MAX_CPUS];
-static int process_comm_event(event_t *event, struct sample_data *sample __used,
+static int process_comm_event(event_t *event, struct perf_sample *sample __used,
struct perf_session *session __used)
{
pid_set_comm(event->comm.tid, event->comm.comm);
return 0;
}
-static int process_fork_event(event_t *event, struct sample_data *sample __used,
+static int process_fork_event(event_t *event, struct perf_sample *sample __used,
struct perf_session *session __used)
{
pid_fork(event->fork.pid, event->fork.ppid, event->fork.time);
return 0;
}
-static int process_exit_event(event_t *event, struct sample_data *sample __used,
+static int process_exit_event(event_t *event, struct perf_sample *sample __used,
struct perf_session *session __used)
{
pid_exit(event->fork.pid, event->fork.time);
static int process_sample_event(event_t *event __used,
- struct sample_data *sample,
+ struct perf_sample *sample,
struct perf_session *session)
{
struct trace_entry *te;
}
static void event__process_sample(const event_t *self,
- struct sample_data *sample,
+ struct perf_sample *sample,
struct perf_session *session)
{
u64 ip = self->ip.ip;
static void perf_session__mmap_read_cpu(struct perf_session *self, int cpu)
{
- struct sample_data sample;
+ struct perf_sample sample;
event_t *event;
while ((event = perf_evlist__read_on_cpu(evsel_list, cpu)) != NULL) {
#include "debug.h"
static int build_id__mark_dso_hit(event_t *event,
- struct sample_data *sample __used,
+ struct perf_sample *sample __used,
struct perf_session *session)
{
struct addr_location al;
return 0;
}
-static int event__exit_del_thread(event_t *self, struct sample_data *sample __used,
+static int event__exit_del_thread(event_t *self, struct perf_sample *sample __used,
struct perf_session *session)
{
struct thread *thread = perf_session__findnew(session, self->fork.tid);
return event__name[id];
}
-static struct sample_data synth_sample = {
+static struct perf_sample synth_sample = {
.pid = -1,
.tid = -1,
.time = -1,
return 0;
}
-int event__process_comm(event_t *self, struct sample_data *sample __used,
+int event__process_comm(event_t *self, struct perf_sample *sample __used,
struct perf_session *session)
{
struct thread *thread = perf_session__findnew(session, self->comm.tid);
return 0;
}
-int event__process_lost(event_t *self, struct sample_data *sample __used,
+int event__process_lost(event_t *self, struct perf_sample *sample __used,
struct perf_session *session)
{
dump_printf(": id:%" PRIu64 ": lost:%" PRIu64 "\n",
return -1;
}
-int event__process_mmap(event_t *self, struct sample_data *sample __used,
+int event__process_mmap(event_t *self, struct perf_sample *sample __used,
struct perf_session *session)
{
struct machine *machine;
return 0;
}
-int event__process_task(event_t *self, struct sample_data *sample __used,
+int event__process_task(event_t *self, struct perf_sample *sample __used,
struct perf_session *session)
{
struct thread *thread = perf_session__findnew(session, self->fork.tid);
return 0;
}
-int event__process(event_t *event, struct sample_data *sample,
+int event__process(event_t *event, struct perf_sample *sample,
struct perf_session *session)
{
switch (event->header.type) {
}
int event__preprocess_sample(const event_t *self, struct perf_session *session,
- struct addr_location *al, struct sample_data *data,
+ struct addr_location *al, struct perf_sample *sample,
symbol_filter_t filter)
{
u8 cpumode = self->header.misc & PERF_RECORD_MISC_CPUMODE_MASK;
al->map ? al->map->dso->long_name :
al->level == 'H' ? "[hypervisor]" : "<not found>");
al->sym = NULL;
- al->cpu = data->cpu;
+ al->cpu = sample->cpu;
if (al->map) {
if (symbol_conf.dso_list &&
u64 array[];
};
-struct sample_data {
+struct perf_sample {
u64 ip;
u32 pid, tid;
u64 time;
typedef int (*event__handler_synth_t)(event_t *event,
struct perf_session *session);
-typedef int (*event__handler_t)(event_t *event, struct sample_data *sample,
+typedef int (*event__handler_t)(event_t *event, struct perf_sample *sample,
struct perf_session *session);
int event__synthesize_thread(pid_t pid, event__handler_t process,
struct perf_session *session,
struct machine *machine);
-int event__process_comm(event_t *self, struct sample_data *sample,
+int event__process_comm(event_t *event, struct perf_sample *sample,
struct perf_session *session);
-int event__process_lost(event_t *self, struct sample_data *sample,
+int event__process_lost(event_t *event, struct perf_sample *sample,
struct perf_session *session);
-int event__process_mmap(event_t *self, struct sample_data *sample,
+int event__process_mmap(event_t *event, struct perf_sample *sample,
struct perf_session *session);
-int event__process_task(event_t *self, struct sample_data *sample,
+int event__process_task(event_t *event, struct perf_sample *sample,
struct perf_session *session);
-int event__process(event_t *event, struct sample_data *sample,
+int event__process(event_t *event, struct perf_sample *sample,
struct perf_session *session);
struct addr_location;
int event__preprocess_sample(const event_t *self, struct perf_session *session,
- struct addr_location *al, struct sample_data *data,
+ struct addr_location *al, struct perf_sample *sample,
symbol_filter_t filter);
const char *event__get_event_name(unsigned int id);
int event__parse_sample(const event_t *event, u64 type, bool sample_id_all,
- struct sample_data *sample);
+ struct perf_sample *sample);
#endif /* __PERF_RECORD_H */
}
static int event__parse_id_sample(const event_t *event, u64 type,
- struct sample_data *sample)
+ struct perf_sample *sample)
{
const u64 *array = event->sample.array;
}
int event__parse_sample(const event_t *event, u64 type, bool sample_id_all,
- struct sample_data *data)
+ struct perf_sample *data)
{
const u64 *array;
static void perf_session__id_header_size(struct perf_session *session)
{
- struct sample_data *data;
+ struct perf_sample *data;
u64 sample_type = session->sample_type;
u16 size = 0;
}
static int process_event_stub(event_t *event __used,
- struct sample_data *sample __used,
+ struct perf_sample *sample __used,
struct perf_session *session __used)
{
dump_printf(": unhandled!\n");
static int perf_session_deliver_event(struct perf_session *session,
event_t *event,
- struct sample_data *sample,
+ struct perf_sample *sample,
struct perf_event_ops *ops,
u64 file_offset);
struct ordered_samples *os = &s->ordered_samples;
struct list_head *head = &os->samples;
struct sample_queue *tmp, *iter;
- struct sample_data sample;
+ struct perf_sample sample;
u64 limit = os->next_flush;
u64 last_ts = os->last_sample ? os->last_sample->timestamp : 0ULL;
#define MAX_SAMPLE_BUFFER (64 * 1024 / sizeof(struct sample_queue))
static int perf_session_queue_event(struct perf_session *s, event_t *event,
- struct sample_data *data, u64 file_offset)
+ struct perf_sample *sample, u64 file_offset)
{
struct ordered_samples *os = &s->ordered_samples;
struct list_head *sc = &os->sample_cache;
- u64 timestamp = data->time;
+ u64 timestamp = sample->time;
struct sample_queue *new;
if (!timestamp || timestamp == ~0ULL)
return 0;
}
-static void callchain__printf(struct sample_data *sample)
+static void callchain__printf(struct perf_sample *sample)
{
unsigned int i;
static void perf_session__print_tstamp(struct perf_session *session,
event_t *event,
- struct sample_data *sample)
+ struct perf_sample *sample)
{
if (event->header.type != PERF_RECORD_SAMPLE &&
!session->sample_id_all) {
}
static void dump_event(struct perf_session *session, event_t *event,
- u64 file_offset, struct sample_data *sample)
+ u64 file_offset, struct perf_sample *sample)
{
if (!dump_trace)
return;
}
static void dump_sample(struct perf_session *session, event_t *event,
- struct sample_data *sample)
+ struct perf_sample *sample)
{
if (!dump_trace)
return;
static int perf_session_deliver_event(struct perf_session *session,
event_t *event,
- struct sample_data *sample,
+ struct perf_sample *sample,
struct perf_event_ops *ops,
u64 file_offset)
{
}
static int perf_session__preprocess_sample(struct perf_session *session,
- event_t *event, struct sample_data *sample)
+ event_t *event, struct perf_sample *sample)
{
if (event->header.type != PERF_RECORD_SAMPLE ||
!(session->sample_type & PERF_SAMPLE_CALLCHAIN))
struct perf_event_ops *ops,
u64 file_offset)
{
- struct sample_data sample;
+ struct perf_sample sample;
int ret;
if (session->header.needs_swap && event__swap_ops[event->header.type])
struct perf_event_ops;
-typedef int (*event_op)(event_t *self, struct sample_data *sample,
+typedef int (*event_op)(event_t *self, struct perf_sample *sample,
struct perf_session *session);
typedef int (*event_synth_op)(event_t *self, struct perf_session *session);
typedef int (*event_op2)(event_t *self, struct perf_session *session,
static inline int perf_session__parse_sample(struct perf_session *session,
const event_t *event,
- struct sample_data *sample)
+ struct perf_sample *sample)
{
return event__parse_sample(event, session->sample_type,
session->sample_id_all, sample);