| 1 |
/* -*- linux-c -*- |
| 2 |
* Perf Header File |
| 3 |
* Copyright (C) 2006-2014 Red Hat Inc. |
| 4 |
* |
| 5 |
* This file is part of systemtap, and is free software. You can |
| 6 |
* redistribute it and/or modify it under the terms of the GNU General |
| 7 |
* Public License (GPL); either version 2, or (at your option) any |
| 8 |
* later version. |
| 9 |
*/ |
| 10 |
|
| 11 |
#ifndef _PERF_H_ |
| 12 |
#define _PERF_H_ |
| 13 |
|
| 14 |
/** @file perf.h |
| 15 |
* @brief Header file for performance monitoring hardware support |
| 16 |
*/ |
| 17 |
|
| 18 |
struct stap_perf_probe { |
| 19 |
struct perf_event_attr attr; |
| 20 |
perf_overflow_handler_t callback; |
| 21 |
const struct stap_probe * const probe; |
| 22 |
union |
| 23 |
{ |
| 24 |
/* per-cpu data. allocated with _stp_alloc_percpu() */ |
| 25 |
struct perf_event * __percpu *events; |
| 26 |
struct |
| 27 |
{ |
| 28 |
/* per-task data. allocated by perf_event_create_kernel_counter */ |
| 29 |
struct perf_event *per_thread_event; |
| 30 |
struct stap_task_finder_target tgt; |
| 31 |
} t; |
| 32 |
} e; |
| 33 |
unsigned system_wide : 1; |
| 34 |
unsigned task_finder : 1; |
| 35 |
struct mutex cb_lock; |
| 36 |
}; |
| 37 |
|
| 38 |
static long _stp_perf_init (struct stap_perf_probe *stp, struct task_struct* task); |
| 39 |
static int _stp_perf_init_n (struct stap_perf_probe *probes, size_t n, const char **ppfail); |
| 40 |
|
| 41 |
static void _stp_perf_del (struct stap_perf_probe *stp); |
| 42 |
static void _stp_perf_del_n (struct stap_perf_probe *probes, size_t n); |
| 43 |
|
| 44 |
#endif /* _PERF_H_ */ |