#include <ksyms/ksyms.h>
#include <kprobe/swap_kprobes.h>
#include <writer/swap_writer_module.h>
+#include <writer/event_filter.h>
#include "ks_features.h"
#include "syscall_list.h"
#include "features_data.c"
{
struct kretprobe *rp = ri->rp;
- if (rp) {
+ if (rp && check_event(current)) {
struct ks_probe *ksp = container_of(rp, struct ks_probe, rp);
const char *fmt = ksp->args;
unsigned long addr = (unsigned long)ksp->rp.kp.addr;
{
struct kretprobe *rp = ri->rp;
- if (rp) {
+ if (rp && check_event(current)) {
unsigned long func_addr = (unsigned long)rp->kp.addr;
unsigned long ret_addr = (unsigned long)ri->ret_addr;
/* ====================== SWITCH_CONTEXT ======================= */
static int switch_entry_handler(struct kretprobe_instance *ri, struct pt_regs *regs)
{
- switch_entry(regs);
+ if (check_event(current))
+ switch_entry(regs);
return 0;
}
static int switch_ret_handler(struct kretprobe_instance *ri, struct pt_regs *regs)
{
- switch_exit(regs);
+ if (check_event(current))
+ switch_exit(regs);
return 0;
}
#include <linux/module.h>
#include <writer/swap_writer_module.h>
+#include <writer/event_filter.h>
#include "swap_sampler_module.h"
#include "swap_sampler_errors.h"
static restart_ret swap_timer_restart(swap_timer *timer)
{
- if (current)
+ if (check_event(current))
sample_msg(task_pt_regs(current));
return sampler_timers_restart(timer);
char *buf, *payload, *buf_end;
int ret;
- if (!check_event(current))
- return 0;
-
buf = get_current_buf();
payload = pack_basic_msg_fmt(buf, MSG_SAMPLE);
buf_end = pack_sample(payload, regs);
char *buf, *payload, *args, *buf_end;
int ret;
- if (pt == PT_KS && !check_event(current))
- return 0;
-
buf = get_current_buf();
payload = pack_basic_msg_fmt(buf, MSG_FUNCTION_ENTRY);
args = pack_msg_func_entry(payload, fmt, func_addr,
char *buf, *payload, *buf_end;
int ret;
- if (!check_event(current))
- return 0;
-
buf = get_current_buf();
payload = pack_basic_msg_fmt(buf, MSG_FUNCTION_EXIT);
/* FIXME: len=1024 */
*/
int switch_entry(struct pt_regs *regs)
{
- if (!check_event(current))
- return 0;
-
return context_switch(regs, MSG_CONTEXT_SWITCH_ENTRY);
}
EXPORT_SYMBOL_GPL(switch_entry);
*/
int switch_exit(struct pt_regs *regs)
{
- if (!check_event(current))
- return 0;
-
return context_switch(regs, MSG_CONTEXT_SWITCH_EXIT);
}
EXPORT_SYMBOL_GPL(switch_exit);