Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 323784
b: refs/heads/master
c: c9f08be
h: refs/heads/master
v: v3
  • Loading branch information
Irina Tirdea authored and Arnaldo Carvalho de Melo committed Sep 8, 2012
1 parent 72e944a commit bf21d97
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9612ef6716efc20fac0f57d59452cda4e6846bda
refs/heads/master: c9f08bee50c71b06685ccff8110e56a7c05662b7
8 changes: 8 additions & 0 deletions trunk/tools/perf/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,14 @@ else
endif
endif

ifdef NO_BACKTRACE
BASIC_CFLAGS += -DNO_BACKTRACE
else
ifneq ($(call try-cc,$(SOURCE_BACKTRACE),),y)
BASIC_CFLAGS += -DNO_BACKTRACE
endif
endif

ifdef ASCIIDOC8
export ASCIIDOC8
endif
Expand Down
14 changes: 14 additions & 0 deletions trunk/tools/perf/config/feature-tests.mak
Original file line number Diff line number Diff line change
Expand Up @@ -179,3 +179,17 @@ int main(void)
}
endef
endif

ifndef NO_BACKTRACE
define SOURCE_BACKTRACE
#include <execinfo.h>
#include <stdio.h>

int main(void)
{
backtrace(NULL, 0);
backtrace_symbols(NULL, 0);
return 0;
}
endef
endif
6 changes: 6 additions & 0 deletions trunk/tools/perf/util/util.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#include "../perf.h"
#include "util.h"
#include <sys/mman.h>
#ifndef NO_BACKTRACE
#include <execinfo.h>
#endif
#include <stdio.h>
#include <stdlib.h>

Expand Down Expand Up @@ -163,6 +165,7 @@ size_t hex_width(u64 v)
}

/* Obtain a backtrace and print it to stdout. */
#ifndef NO_BACKTRACE
void dump_stack(void)
{
void *array[16];
Expand All @@ -177,3 +180,6 @@ void dump_stack(void)

free(strings);
}
#else
void dump_stack(void) {}
#endif

0 comments on commit bf21d97

Please sign in to comment.