From a846e9cd2b991b2b6f895b45f0a2af1ce2c994bc Mon Sep 17 00:00:00 2001 From: hunt Date: Wed, 14 Mar 2007 16:11:30 +0000 Subject: 2007-03-14 Martin Hunt * staprun.c: Renamed from stpd.c. Removed quiet and print_only options. Added "-x" option as an alias for "-t". Removed "-m" option. Updated arg processing to leave 4 slots for modoptions[]. Bump the priority of staprun. * ctl.c: New. Transport control channel functions. * relay.c: New. Relayfs control functions for new transport. * relay_old.c: New. Relayfs control functions for older versions of relayfs. * mainloop.c: New. Staprun main loop. * staprun.h: Renamed from librelay.h. Cleaned up. * stap_merge.c: Renamed. Updated for modified save format. --- runtime/staprun/staprun.h | 91 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 runtime/staprun/staprun.h (limited to 'runtime/staprun/staprun.h') diff --git a/runtime/staprun/staprun.h b/runtime/staprun/staprun.h new file mode 100644 index 00000000..d8664802 --- /dev/null +++ b/runtime/staprun/staprun.h @@ -0,0 +1,91 @@ +/* -*- linux-c -*- + * + * staprun.h - include file for staprun + * + * This file is part of systemtap, and is free software. You can + * redistribute it and/or modify it under the terms of the GNU General + * Public License (GPL); either version 2, or (at your option) any + * later version. + * + * Copyright (C) 2005-2007 Red Hat Inc. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,15) +#define STP_OLD_TRANSPORT +#endif +#include "../transport/transport_msgs.h" + + +#define RELAYFS_MAGIC 0xF0B4A981 +#define DEBUGFS_MAGIC 0x64626720 + +#ifdef DEBUG +#define dbug(args...) {fprintf(stderr,"%s:%d ",__FUNCTION__, __LINE__); fprintf(stderr,args); } +#else +#define dbug(args...) ; +#endif /* DEBUG */ + +/* + * function prototypes + */ +int init_staprun(void); +int stp_main_loop(void); +int send_request(int type, void *data, int len); +void cleanup_and_exit (int); +int do_module(void *); +void do_kernel_symbols(void); +int init_ctl_channel(void); +int init_relayfs(struct _stp_msg_trans *); +void close_relayfs(void); +void close_ctl_channel(void); + +/* + * variables + */ +extern int control_channel; +extern int ncpus; + +/* flags */ +extern int verbose; +extern unsigned int buffer_size; +extern char *modname; +extern char *modpath; +extern char *modoptions[]; +extern int target_pid; +extern int driver_pid; +extern char *target_cmd; +extern char *outfile_name; + +/* uid/gid to use when execing external programs */ +extern uid_t cmd_uid; +extern gid_t cmd_gid; + +/* maximum number of CPUs we can handle */ +#define NR_CPUS 256 + +/* output fd's (percpu) */ +extern int out_fd[NR_CPUS]; -- cgit