/* main header file * Copyright (C) 2005 Red Hat Inc. * * 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. */ #ifndef _RUNTIME_H_ #define _RUNTIME_H_ /** @file runtime.h * @brief Main include file for runtime functions. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef DEBUG /** Prints debug line. * This function prints a debug message immediately to stpd. * If the last character is not a newline, then one is added. * @param args A variable number of args in a format like printf. */ #define dbug(args...) _stp_dbug(__FUNCTION__, __LINE__, args) #else #define dbug(args...) ; #endif /* DEBUG */ /* atomic globals */ static atomic_t _stp_transport_failures = ATOMIC_INIT (0); #ifndef STP_NETLINK_ONLY static struct { atomic_t ____cacheline_aligned_in_smp seq; } _stp_seq = { ATOMIC_INIT (0) }; #define _stp_seq_inc() (atomic_inc_return(&_stp_seq.seq)) #endif #include "print.c" #include "string.c" /************* Module Stuff ********************/ int probe_start(void); int init_module(void) { int ret; /* First open connection. This exits on failure. */ TRANSPORT_OPEN; ret = probe_start(); if (ret < 0) _stp_transport_close(); } void cleanup_module(void) { _stp_transport_cleanup(); _stp_transport_close(); } MODULE_LICENSE("GPL"); #endif /* _RUNTIME_H_ */