#define _FILE_OFFSET_BITS 64
#include <linux/kernel.h>
#include <byteswap.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/mman.h>
#include "evlist.h"
#include "evsel.h"
#include "session.h"
#include "tool.h"
#include "sort.h"
#include "util.h"
#include "cpumap.h"
static int perf_session__open(struct perf_session *self, bool force)
{
struct stat input_stat;
if (!strcmp(self->filename, "-")) {
self->fd_pipe = true;
self->fd = STDIN_FILENO;
if (perf_session__read_header(self, self->fd) < 0)
pr_err("incompatible file format (rerun with -v to learn more)");
return 0;
}
self->fd = open(self->filename, O_RDONLY);
if (self->fd