u64 test_tsc, comm1_tsc, comm2_tsc;
u64 test_time, comm1_time = 0, comm2_time = 0;
struct perf_mmap *md;
- u64 end, start;
threads = thread_map__new(-1, getpid(), UINT_MAX);
CHECK_NOT_NULL__(threads);
for (i = 0; i < evlist->nr_mmaps; i++) {
md = &evlist->mmap[i];
- if (perf_mmap__read_init(md, false, &start, &end) < 0)
+ if (perf_mmap__read_init(md) < 0)
continue;
while ((event = perf_mmap__read_event(md)) != NULL) {
struct perf_evlist *evlist = kvm->evlist;
union perf_event *event;
struct perf_mmap *md;
- u64 end, start;
u64 timestamp;
s64 n = 0;
int err;
*mmap_time = ULLONG_MAX;
md = &evlist->mmap[idx];
- err = perf_mmap__read_init(md, false, &start, &end);
+ err = perf_mmap__read_init(md);
if (err < 0)
return (err == -EAGAIN) ? 0 : -1;
struct perf_session *session = top->session;
union perf_event *event;
struct machine *machine;
- u64 end, start;
int ret;
md = opts->overwrite ? &evlist->overwrite_mmap[idx] : &evlist->mmap[idx];
- if (perf_mmap__read_init(md, opts->overwrite, &start, &end) < 0)
+ if (perf_mmap__read_init(md) < 0)
return;
while ((event = perf_mmap__read_event(md)) != NULL) {
for (i = 0; i < evlist->nr_mmaps; i++) {
union perf_event *event;
struct perf_mmap *md;
- u64 end, start;
md = &evlist->mmap[i];
- if (perf_mmap__read_init(md, false, &start, &end) < 0)
+ if (perf_mmap__read_init(md) < 0)
continue;
while ((event = perf_mmap__read_event(md)) != NULL) {
for (i = 0; i < evlist->nr_mmaps; i++) {
struct perf_mmap *map = &evlist->overwrite_mmap[i];
union perf_event *event;
- u64 start, end;
- perf_mmap__read_init(map, true, &start, &end);
+ perf_mmap__read_init(map);
while ((event = perf_mmap__read_event(map)) != NULL) {
const u32 type = event->header.type;
for (i = 0; i < evlist->nr_mmaps; i++) {
union perf_event *event;
struct perf_mmap *md;
- u64 end, start;
md = &evlist->mmap[i];
- if (perf_mmap__read_init(md, false, &start, &end) < 0)
+ if (perf_mmap__read_init(md) < 0)
continue;
while ((event = perf_mmap__read_event(md)) != NULL) {
{
union perf_event *event;
struct perf_mmap *md;
- u64 end, start;
int i, ret;
for (i = 0; i < evlist->nr_mmaps; i++) {
md = &evlist->mmap[i];
- if (perf_mmap__read_init(md, false, &start, &end) < 0)
+ if (perf_mmap__read_init(md) < 0)
continue;
while ((event = perf_mmap__read_event(md)) != NULL) {
{
union perf_event *event;
struct perf_mmap *md;
- u64 end, start;
int i, found;
found = 0;
for (i = 0; i < evlist->nr_mmaps; i++) {
md = &evlist->mmap[i];
- if (perf_mmap__read_init(md, false, &start, &end) < 0)
+ if (perf_mmap__read_init(md) < 0)
continue;
while ((event = perf_mmap__read_event(md)) != NULL) {
if (event->header.type == PERF_RECORD_COMM &&
struct perf_evsel *evsels[nsyscalls], *evsel;
char sbuf[STRERR_BUFSIZE];
struct perf_mmap *md;
- u64 end, start;
threads = thread_map__new(-1, getpid(), UINT_MAX);
if (threads == NULL) {
}
md = &evlist->mmap[0];
- if (perf_mmap__read_init(md, false, &start, &end) < 0)
+ if (perf_mmap__read_init(md) < 0)
goto out_init;
while ((event = perf_mmap__read_event(md)) != NULL) {
for (i = 0; i < evlist->nr_mmaps; i++) {
union perf_event *event;
struct perf_mmap *md;
- u64 end, start;
md = &evlist->mmap[i];
- if (perf_mmap__read_init(md, false, &start, &end) < 0)
+ if (perf_mmap__read_init(md) < 0)
continue;
while ((event = perf_mmap__read_event(md)) != NULL) {
for (i = 0; i < evlist->nr_mmaps; i++) {
union perf_event *event;
struct perf_mmap *md;
- u64 end, start;
md = &evlist->mmap[i];
- if (perf_mmap__read_init(md, false, &start, &end) < 0)
+ if (perf_mmap__read_init(md) < 0)
continue;
while ((event = perf_mmap__read_event(md)) != NULL) {
struct cpu_map *cpus;
struct thread_map *threads;
struct perf_mmap *md;
- u64 end, start;
attr.sample_freq = 500;
perf_evlist__disable(evlist);
md = &evlist->mmap[0];
- if (perf_mmap__read_init(md, false, &start, &end) < 0)
+ if (perf_mmap__read_init(md) < 0)
goto out_init;
while ((event = perf_mmap__read_event(md)) != NULL) {
LIST_HEAD(events);
struct event_node *events_array, *node;
struct perf_mmap *md;
- u64 end, start;
int i, ret;
for (i = 0; i < evlist->nr_mmaps; i++) {
md = &evlist->mmap[i];
- if (perf_mmap__read_init(md, false, &start, &end) < 0)
+ if (perf_mmap__read_init(md) < 0)
continue;
while ((event = perf_mmap__read_event(md)) != NULL) {
struct cpu_map *cpus;
struct thread_map *threads;
struct perf_mmap *md;
- u64 end, start;
signal(SIGCHLD, sig_handler);
retry:
md = &evlist->mmap[0];
- if (perf_mmap__read_init(md, false, &start, &end) < 0)
+ if (perf_mmap__read_init(md) < 0)
goto out_init;
while ((event = perf_mmap__read_event(md)) != NULL) {
/*
* Report the start and end of the available data in ringbuffer
*/
-int perf_mmap__read_init(struct perf_mmap *md, bool overwrite,
- u64 *startp, u64 *endp)
+int perf_mmap__read_init(struct perf_mmap *md)
{
u64 head = perf_mmap__read_head(md);
u64 old = md->prev;
unsigned char *data = md->base + page_size;
unsigned long size;
- *startp = overwrite ? head : old;
- *endp = overwrite ? old : head;
md->start = md->overwrite ? head : old;
md->end = md->overwrite ? old : head;
*/
if (overwrite_rb_find_range(data, md->mask, head, &md->start, &md->end))
return -EINVAL;
- *startp = md->start;
- *endp = md->end;
}
return 0;
int push(void *to, void *buf, size_t size))
{
u64 head = perf_mmap__read_head(md);
- u64 end, start;
unsigned char *data = md->base + page_size;
unsigned long size;
void *buf;
int rc = 0;
- rc = perf_mmap__read_init(md, md->overwrite, &start, &end);
+ rc = perf_mmap__read_init(md);
if (rc < 0)
return (rc == -EAGAIN) ? 0 : -1;
size_t perf_mmap__mmap_len(struct perf_mmap *map);
-int perf_mmap__read_init(struct perf_mmap *md, bool overwrite,
- u64 *startp, u64 *endp);
+int perf_mmap__read_init(struct perf_mmap *md);
void perf_mmap__read_done(struct perf_mmap *map);
#endif /*__PERF_MMAP_H */
int sample_id_all = 1, cpu;
static char *kwlist[] = { "cpu", "sample_id_all", NULL };
struct perf_mmap *md;
- u64 end, start;
int err;
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i|i", kwlist,
return NULL;
md = &evlist->mmap[cpu];
- if (perf_mmap__read_init(md, false, &start, &end) < 0)
+ if (perf_mmap__read_init(md) < 0)
goto end;
event = perf_mmap__read_event(md);