| 1 |
/* -*- linux-c -*- |
| 2 |
* Perf Read Header File |
| 3 |
* Copyright (C) 2006-2013 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_READ_H_ |
| 12 |
#define _PERF_READ_H_ |
| 13 |
|
| 14 |
/** @file perf.h |
| 15 |
* @brief Header file for performance monitoring hardware support |
| 16 |
*/ |
| 17 |
|
| 18 |
#ifdef _HAVE_PERF_ |
| 19 |
// perf counter probes call _stp_perf_read |
| 20 |
struct task_struct; |
| 21 |
static int _stp_perf_read_init (unsigned i, struct task_struct* pid); |
| 22 |
static long _stp_perf_read (int ncpu, unsigned i); |
| 23 |
#else |
| 24 |
// stapiu_target_reg references _stp_perf_read_init |
| 25 |
// but will only call it for a perf counter probe |
| 26 |
struct task_struct; |
| 27 |
static int _stp_perf_read_init (unsigned i, struct task_struct* pid) {return 0;}; |
| 28 |
static long _stp_perf_read (int ncpu, unsigned i) {return 0;}; |
| 29 |
#endif |
| 30 |
|
| 31 |
#endif /* _PERF_READ_H_ */ |