Added source files for tracecuts feature.
authorJustin Seyster <jseyster@cs.sunysb.edu>
Tue, 1 Feb 2011 01:06:55 +0000 (20:06 -0500)
committerJustin Seyster <jseyster@cs.sunysb.edu>
Tue, 1 Feb 2011 01:06:55 +0000 (20:06 -0500)
Doxyfile
src/Makefile.am
src/aop-doxy-main.c
src/tracecut.c [new file with mode: 0644]
src/tracecut.h [new file with mode: 0644]

index af9429419a2cbd1e479a5099b1d231020cf3b710..a537fa5a6dbd01efb7d7579dd033186db776f56e 100644 (file)
--- a/Doxyfile
+++ b/Doxyfile
@@ -585,7 +585,7 @@ INPUT_ENCODING         = UTF-8
 # *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
 # *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
 
-FILE_PATTERNS          = aop.h *.c
+FILE_PATTERNS          = aop.h tracecut.h *.c
 
 # The RECURSIVE tag can be used to turn specify whether or not subdirectories
 # should be searched for input files as well. Possible values are YES and NO.
index b596c80f750f85b40d1d521b7e871e781c829e6c..377553ed616fe00c0b078c4658b39a900f45032f 100644 (file)
@@ -1,7 +1,7 @@
 lib_LTLIBRARIES = libinteraspect.la
 libinteraspect_la_SOURCES = aop-pc-assign.c aop-main.c aop-type.c aop-weave.c \
        aop-pc-entry.c aop-pc-exit.c aop-pc-fun-call.c aop-header.c \
-       aop-pointcut.c aop-duplicate.c
+       aop-pointcut.c aop-duplicate.c tracecut.c
 libinteraspect_la_CFLAGS = -Wall -Werror -fvisibility=hidden -prefer-pic
 libinteraspect_la_LDFLAGS = -static -prefer-pic -version-info 1:0:0
 libinteraspect_la_CPPFLAGS = -DHAVE_CONFIG_H -DIN_GCC -I$(gcc_includes)
index 3fb10705f4ad745616821b46b9bf45c219e8ffc6..7e5cd602109533e9c379860a680b44309816308f 100644 (file)
  * objects for you when the compiler exits.
  */
 
+/**
+ * \struct tc_tracecut
+ * \brief A tracecut object.
+ *
+ * A tracecut event represents a set of program events parameterized
+ * on program objects.  The tracecut runtime can monitor program
+ * objects to see when an object performs a sequence of events
+ * (specified with a regular expression).
+ *
+ * Each tracecut must be freed manually with tc_free_tracecut().
+ */
+
 /**
  * \example hello.c
  * A "hello world" example that shows the minimum setup necessary to
diff --git a/src/tracecut.c b/src/tracecut.c
new file mode 100644 (file)
index 0000000..5ea4103
--- /dev/null
@@ -0,0 +1,96 @@
+/* Copyright (c) 2011 Justin Seyster
+   Copyright (c) 2011 Erez Zadok
+   Copyright (c) 2011 Stony Brook University
+   Copyright (c) 2011 The Research Foundation of SUNY
+
+   This program is free software: you can redistribute it and/or
+   modify it under the terms of the GNU General Public License as
+   published by the Free Software Foundation, either version 3 of the
+   License, or (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License
+   and a copy of the GCC Runtime Library Exception along with this
+   program; see the files COPYING and COPYING.RUNTIME respectively.
+   If not, see <http://www.gnu.org/licenses/>. */
+
+/* Whether we want them or not (we don't), Autoconf _insists_ on
+   defining these.  Since GCC's config.h (which we must include) also
+   defines them, we have to undef them here. */
+#undef PACKAGE_BUGREPORT
+#undef PACKAGE_NAME
+#undef PACKAGE_STRING
+#undef PACKAGE_TARNAME
+#undef PACKAGE_VERSION
+
+#include <locale.h>
+#include <stdlib.h>
+
+#include "aop.h"
+#include "tracecut.h"
+
+/**
+ * \cond HIDDEN_SYMBOLS
+ */
+struct tc_call_symbol {
+  const char *name;
+  const char *func_name;
+
+  struct tc_call_symbol *next;
+};
+
+struct tc_tracecut {
+  struct tracecut_symbol *tc_symbol_list;
+};
+/**
+ * \endcond
+ */
+
+/**
+ * \defgroup tracecut Tracecut Functions
+ * \{
+ */
+
+/**
+ * Create an empty tc_tracecut object.  The caller is responsible for
+ * freeing the object using tc_free_tracecut().
+ * \return A new tc_tracecut that must be freed with
+ * tc_free_tracecut().
+ */
+struct tc_tracecut *
+tc_create_tracecut (void)
+{
+  struct tc_tracecut *tc;
+
+  tc = (struct tc_tracecut *)malloc (sizeof (struct tc_tracecut));
+  aop_assert (tc != NULL);
+
+  tc->tc_symbol_list = NULL;
+
+  return tc;
+}
+
+/**
+ * Free all the memory used by a tc_object.  Every call to
+ * tc_create_tracecut() should have a matching call to
+ * tc_free_tracecut().
+ * \param tc The tracecut object to free.
+ */
+void
+tc_free_tracecut (struct tc_tracecut *tc)
+{
+  free(tc);
+}
+
+/* Close Doxygen defgroup block. */
+/**
+ * \}
+ */
diff --git a/src/tracecut.h b/src/tracecut.h
new file mode 100644 (file)
index 0000000..407f1c6
--- /dev/null
@@ -0,0 +1,48 @@
+#ifndef __AOP_TRACECUT_H__
+#define __AOP_TRACECUT_H__
+
+/* Copyright (c) 2011 Justin Seyster
+   Copyright (c) 2011 Erez Zadok
+   Copyright (c) 2011 Stony Brook University
+   Copyright (c) 2011 The Research Foundation of SUNY
+
+   This program is free software: you can redistribute it and/or
+   modify it under the terms of the GNU General Public License as
+   published by the Free Software Foundation, either version 3 of the
+   License, or (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License
+   and a copy of the GCC Runtime Library Exception along with this
+   program; see the files COPYING and COPYING.RUNTIME respectively.
+   If not, see <http://www.gnu.org/licenses/>. */
+
+/**
+ * \file tracecut.h
+ * \brief The public interface for InterAspect tracecuts, an extension
+ * to the InterAspect framework.
+ *
+ * A tracecut can track sequences of events on a program object (or a
+ * set of program objects) using regular expressions.
+ *
+ * Though included in the InterAspect distribution, the tracecut
+ * extension only uses InterAspect's external API, making it a good
+ * example of how to use the API.
+ *
+ * All tracecut functions have a <code>tc_</code> prefix.
+ */
+
+struct tc_tracecut;
+
+extern struct tc_tracecut *tc_create_tracecut (void);
+extern void tc_free_tracecut (struct tc_tracecut *tc);
+
+#endif