Skip to content

Commit

Permalink
Add a startup tracepoint.
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
  • Loading branch information
simark committed Jan 22, 2014
1 parent 18d5268 commit 2c6d73c
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile.in
Expand Up @@ -4,7 +4,7 @@ CLEAN_SUBDIRS = test

PROGRAM_NAME = $(progname)
PROGRAM_SOURCES = modules.c
PROGRAM_LDADD = buildmark.o $(HTTPD_LDFLAGS) $(PROGRAM_DEPENDENCIES) $(HTTPD_LIBS) $(EXTRA_LIBS) $(AP_LIBS) $(LIBS)
PROGRAM_LDADD = buildmark.o $(HTTPD_LDFLAGS) $(PROGRAM_DEPENDENCIES) $(HTTPD_LIBS) $(EXTRA_LIBS) $(AP_LIBS) $(LIBS) -ldl -llttng-ust
PROGRAM_PRELINK = $(COMPILE) -c $(top_srcdir)/server/buildmark.c
PROGRAM_DEPENDENCIES = \
server/libmain.la \
Expand Down
2 changes: 1 addition & 1 deletion server/Makefile.in
Expand Up @@ -18,7 +18,7 @@ LTLIBRARY_SOURCES = \
apreq_cookie.c apreq_error.c apreq_module.c \
apreq_module_cgi.c apreq_module_custom.c apreq_param.c \
apreq_parser.c apreq_parser_header.c apreq_parser_multipart.c \
apreq_parser_urlencoded.c apreq_util.c
apreq_parser_urlencoded.c apreq_util.c tracepoints.c

LTLIBRARY_DEPENDENCIES = test_char.h

Expand Down
4 changes: 4 additions & 0 deletions server/main.c
Expand Up @@ -41,6 +41,8 @@
#include "util_ebcdic.h"
#include "ap_mpm.h"

#include "tracepoints.h"

#if APR_HAVE_UNISTD_H
#include <unistd.h>
#else
Expand Down Expand Up @@ -298,6 +300,8 @@ static process_rec *init_process(int *argc, const char * const * *argv)
apr_status_t stat;
const char *failed = "apr_app_initialize()";

tracepoint(apache, apache_process_entry);

stat = apr_app_initialize(argc, argv, NULL);
if (stat == APR_SUCCESS) {
failed = "apr_pool_create()";
Expand Down
7 changes: 7 additions & 0 deletions server/tracepoints.c
@@ -0,0 +1,7 @@

#define TRACEPOINT_CREATE_PROBES
/*
* The header containing our TRACEPOINT_EVENTs.
*/
#define TRACEPOINT_DEFINE
#include "tracepoints.h"
22 changes: 22 additions & 0 deletions server/tracepoints.h
@@ -0,0 +1,22 @@

#undef TRACEPOINT_PROVIDER
#define TRACEPOINT_PROVIDER apache

#undef TRACEPOINT_INCLUDE
#define TRACEPOINT_INCLUDE "./tracepoints.h"

#if !defined(TRACEPOINTS_H) || defined(TRACEPOINT_HEADER_MULTI_READ)
#define TRACEPOINTS_H

#include <lttng/tracepoint.h>

TRACEPOINT_EVENT(
apache,
apache_process_entry,
TP_ARGS(),
TP_FIELDS()
)

#endif /* TRACEPOINTS_H */

#include <lttng/tracepoint-event.h>
6 changes: 6 additions & 0 deletions server/tracepoints.tp
@@ -0,0 +1,6 @@
TRACEPOINT_EVENT(
apache,
apache_process_entry,
TP_ARGS(),
TP_FIELDS()
)

0 comments on commit 2c6d73c

Please sign in to comment.