| 1 |
/* -*- linux-c -*- |
| 2 |
* Copyright (C) 2010, 2013 Red Hat Inc. |
| 3 |
* |
| 4 |
* This file is part of systemtap, and is free software. You can |
| 5 |
* redistribute it and/or modify it under the terms of the GNU General |
| 6 |
* Public License (GPL); either version 2, or (at your option) any |
| 7 |
* later version. |
| 8 |
*/ |
| 9 |
|
| 10 |
#ifndef _UPROBE_COMMON_H_ |
| 11 |
#define _UPROBE_COMMON_H_ |
| 12 |
|
| 13 |
struct stap_uprobe { |
| 14 |
union { struct uprobe up; struct uretprobe urp; }; |
| 15 |
int spec_index; /* index into stap_uprobe_specs; <0 == free && unregistered */ |
| 16 |
unsigned long sdt_sem_address; |
| 17 |
}; |
| 18 |
|
| 19 |
struct stap_uprobe_tf { |
| 20 |
struct stap_task_finder_target finder; |
| 21 |
const char *pathname; |
| 22 |
}; |
| 23 |
|
| 24 |
struct stap_uprobe_spec { |
| 25 |
unsigned tfi; |
| 26 |
unsigned return_p:1; |
| 27 |
unsigned long address; |
| 28 |
unsigned long sdt_sem_offset; |
| 29 |
|
| 30 |
// List of perf counters used by each probe |
| 31 |
// This list is an index into struct stap_perf_probe, |
| 32 |
long perf_counters_dim; |
| 33 |
long *perf_counters; |
| 34 |
void (*perf_read_handler)(long *values); |
| 35 |
|
| 36 |
const struct stap_probe * const probe; |
| 37 |
}; |
| 38 |
|
| 39 |
static int stap_uprobe_process_found (struct stap_task_finder_target *tgt, struct task_struct *tsk, int register_p, int process_p); |
| 40 |
static int stap_uprobe_mmap_found (struct stap_task_finder_target *tgt, struct task_struct *tsk, char *path, struct dentry *dentry, unsigned long addr, unsigned long length, unsigned long offset, unsigned long vm_flags); |
| 41 |
static int stap_uprobe_munmap_found (struct stap_task_finder_target *tgt, struct task_struct *tsk, unsigned long addr, unsigned long length); |
| 42 |
static int stap_uprobe_process_munmap (struct stap_task_finder_target *tgt, struct task_struct *tsk, int register_p, int process_p); |
| 43 |
|
| 44 |
#endif /* _UPROBE_COMMON_H_ */ |