builtin-lock.c (e4da3fbfbd1de56d2367653e3823e6445e49f8a9) builtin-lock.c (efad14150a0b4429f37da7245001a8096ef7ee38)
1#include "builtin.h"
2#include "perf.h"
3
4#include "util/util.h"
5#include "util/cache.h"
6#include "util/symbol.h"
7#include "util/thread.h"
8#include "util/header.h"
9
10#include "util/parse-options.h"
11#include "util/trace-event.h"
12
13#include "util/debug.h"
14#include "util/session.h"
1#include "builtin.h"
2#include "perf.h"
3
4#include "util/util.h"
5#include "util/cache.h"
6#include "util/symbol.h"
7#include "util/thread.h"
8#include "util/header.h"
9
10#include "util/parse-options.h"
11#include "util/trace-event.h"
12
13#include "util/debug.h"
14#include "util/session.h"
15#include "util/tool.h"
15
16#include <sys/types.h>
17#include <sys/prctl.h>
18#include <semaphore.h>
19#include <pthread.h>
20#include <math.h>
21#include <limits.h>
22

--- 297 unchanged lines hidden (view full) ---

320
321 list_add(&new->hash_entry, entry);
322 return new;
323
324alloc_failed:
325 die("memory allocation failed\n");
326}
327
16
17#include <sys/types.h>
18#include <sys/prctl.h>
19#include <semaphore.h>
20#include <pthread.h>
21#include <math.h>
22#include <limits.h>
23

--- 297 unchanged lines hidden (view full) ---

321
322 list_add(&new->hash_entry, entry);
323 return new;
324
325alloc_failed:
326 die("memory allocation failed\n");
327}
328
328static char const *input_name = "perf.data";
329static const char *input_name;
329
330struct raw_event_sample {
331 u32 size;
332 char data[0];
333};
334
335struct trace_acquire_event {
336 void *addr;

--- 503 unchanged lines hidden (view full) ---

840 if (info_threads)
841 dump_threads();
842 else if (info_map)
843 dump_map();
844 else
845 die("Unknown type of information\n");
846}
847
330
331struct raw_event_sample {
332 u32 size;
333 char data[0];
334};
335
336struct trace_acquire_event {
337 void *addr;

--- 503 unchanged lines hidden (view full) ---

841 if (info_threads)
842 dump_threads();
843 else if (info_map)
844 dump_map();
845 else
846 die("Unknown type of information\n");
847}
848
848static int process_sample_event(union perf_event *event,
849static int process_sample_event(struct perf_tool *tool __used,
850 union perf_event *event,
849 struct perf_sample *sample,
850 struct perf_evsel *evsel __used,
851 struct perf_sample *sample,
852 struct perf_evsel *evsel __used,
851 struct perf_session *s)
853 struct machine *machine)
852{
854{
853 struct thread *thread = perf_session__findnew(s, sample->tid);
855 struct thread *thread = machine__findnew_thread(machine, sample->tid);
854
855 if (thread == NULL) {
856 pr_debug("problem processing %d event, skipping it.\n",
857 event->header.type);
858 return -1;
859 }
860
861 process_raw_event(sample->raw_data, sample->cpu, sample->time, thread);
862
863 return 0;
864}
865
856
857 if (thread == NULL) {
858 pr_debug("problem processing %d event, skipping it.\n",
859 event->header.type);
860 return -1;
861 }
862
863 process_raw_event(sample->raw_data, sample->cpu, sample->time, thread);
864
865 return 0;
866}
867
866static struct perf_event_ops eops = {
868static struct perf_tool eops = {
867 .sample = process_sample_event,
868 .comm = perf_event__process_comm,
869 .ordered_samples = true,
870};
871
872static int read_events(void)
873{
874 session = perf_session__new(input_name, O_RDONLY, 0, false, &eops);

--- 143 unchanged lines hidden ---
869 .sample = process_sample_event,
870 .comm = perf_event__process_comm,
871 .ordered_samples = true,
872};
873
874static int read_events(void)
875{
876 session = perf_session__new(input_name, O_RDONLY, 0, false, &eops);

--- 143 unchanged lines hidden ---