Go to the documentation of this file.
38 #ifndef __CPU_KVM_PERFEVENT_HH__
39 #define __CPU_KVM_PERFEVENT_HH__
41 #include <linux/perf_event.h>
42 #include <sys/types.h>
46 #include "config/have_perf_attr_exclude_host.hh"
87 attr.sample_period = period;
100 attr.wakeup_events = events;
142 #if HAVE_PERF_ATTR_EXCLUDE_HOST == 1
281 uint64_t
read()
const;
339 int fcntl(
int cmd,
long p1);
340 int fcntl(
int cmd,
void *p1) {
return fcntl(cmd, (
long)p1); }
353 int ioctl(
int request,
long p1);
354 int ioctl(
int request,
void *p1) {
return ioctl(request, (
long)p1); }
364 void read(
void *buf,
size_t size)
const;
An instance of a performance counter.
PerfKvmCounter & operator=(const PerfKvmCounter &that)
PerfKvmCounterConfig(uint32_t type, uint64_t config)
Initialize PerfEvent counter configuration structure.
pid_t sysGettid()
Get the TID of the current thread.
PerfKvmCounterConfig & exclude_host(bool val)
Exclude the events from the host (i.e., only include events from the guest system).
void mmapPerf(int pages)
MMAP the PerfEvent file descriptor.
int fd
PerfEvent file descriptor associated with counter.
PerfKvmCounterConfig & samplePeriod(uint64_t period)
Set the initial sample period (overflow count) of an event.
PerfKvmCounterConfig & wakeupEvents(uint32_t events)
Set the number of samples that need to be triggered before reporting data as being available on the p...
void detach()
Detach a counter from PerfEvent.
struct perf_event_attr attr
Underlying perf_event_attr structure describing the counter.
int fcntl(int cmd, long p1)
PerfEvent fnctl interface.
long pageSize
Cached host page size.
struct perf_event_mmap_page * ringBuffer
Memory mapped PerfEvent sample ring buffer.
PerfEvent counter configuration.
void period(uint64_t period)
Update the period of an overflow counter.
void enableSignals(pid_t tid, int signal)
Enable signal delivery to a thread on counter overflow.
void start()
Start counting.
void attach(PerfKvmCounterConfig &config, pid_t tid, const PerfKvmCounter &parent)
Attach a counter and make it a member of an existing counter group.
int ioctl(int request, void *p1)
void stop()
Stop counting.
uint64_t read() const
Read the current value of a counter.
void enableSignals(int signal)
Enable signal delivery on counter overflow.
PerfKvmCounterConfig & disabled(bool val)
Don't start the performance counter automatically when attaching it.
PerfKvmCounter()
Create a new counter, but don't attach it.
bool attached() const
Check if a counter is attached.
void attach(PerfKvmCounterConfig &config, pid_t tid)
Attach a counter.
PerfKvmCounterConfig & exclude_hv(bool val)
Exclude the hyper visor (i.e., only include events from the guest system).
int ringNumPages
Total number of pages in ring buffer.
int fcntl(int cmd, void *p1)
PerfKvmCounterConfig & pinned(bool val)
Force the group to be on the active all the time (i.e., disallow multiplexing).
void refresh(int refresh)
Enable a counter for a fixed number of events.
int ioctl(int request, long p1)
PerfEvent ioctl interface.
Generated on Wed Sep 30 2020 14:02:08 for gem5 by doxygen 1.8.17