Skip to content

Commit

Permalink
Add tesla event handling sysctl.
Browse files Browse the repository at this point in the history
  • Loading branch information
trombonehero committed Jun 20, 2013
1 parent cf958a4 commit f9f6436
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
6 changes: 6 additions & 0 deletions include/libtesla.h
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,12 @@ int tesla_set_event_handler(struct tesla_event_handlers *);
/** Register a set of event handling vectors. */
int tesla_set_event_handlers(struct tesla_event_metahandler *);

#ifdef _KERNEL
#define TESLA_KERN_PRINTF_EV 0x1
#define TESLA_KERN_DTRACE_EV 0x2
#define TESLA_KERN_PANIC_EV 0x4
#endif

/** @} */

#endif /* _TESLA_STATE */
10 changes: 10 additions & 0 deletions libtesla/src/tesla_notification.c
Original file line number Diff line number Diff line change
Expand Up @@ -364,4 +364,14 @@ static struct tesla_event_metahandler default_event_handlers = {
.tem_handlers = default_handlers,
};

#ifdef _KERNEL
#include <sys/sysctl.h>

SYSCTL_NODE(, OID_AUTO, tesla, CTLFLAG_RW, 0, "TESLA");
SYSCTL_NODE(_tesla, OID_AUTO, events, CTLFLAG_RW, 0, "control of TESLA events");
SYSCTL_UINT(_tesla_events, OID_AUTO, handlers, CTLFLAG_RW,
&default_event_handlers.tem_mask, 0,
"Mask of currently-enabled TESLA event handlers");
#endif

static struct tesla_event_metahandler *event_handlers = &default_event_handlers;

0 comments on commit f9f6436

Please sign in to comment.