[PATCH -tip 12/12] perf: Export debuginfo object without dwarf support

From: Masami Hiramatsu
Date: Wed Mar 30 2011 - 05:33:38 EST


Export debuginfo object interfaces without dwarf support.
This allows other objects to include debuginfo object.

Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@xxxxxxxxxxx>
---

tools/perf/util/probe-finder.h | 56 +++++++++++++++++++++++++++++++++++++++-
1 files changed, 54 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/probe-finder.h b/tools/perf/util/probe-finder.h
index c478b42..ffa6377 100644
--- a/tools/perf/util/probe-finder.h
+++ b/tools/perf/util/probe-finder.h
@@ -3,6 +3,7 @@

#include <stdbool.h>
#include "util.h"
+#include "trace-event.h" /* For __unused */
#include "probe-event.h"

#define MAX_PATH_LEN 256
@@ -15,12 +16,12 @@ static inline int is_c_varname(const char *name)
return isalpha(name[0]) || name[0] == '_';
}

+struct debuginfo;
+
#ifdef DWARF_SUPPORT

#include "dwarf-aux.h"

-/* TODO: export debuginfo data structure even if no dwarf support */
-
/* debug information structure */
struct debuginfo {
Dwarf *dbg;
@@ -103,6 +104,57 @@ struct line_finder {
int found;
};

+#else
+
+static inline struct debuginfo *debuginfo__new(const char *path __unused)
+{
+ return NULL;
+}
+
+static inline struct debuginfo *
+debuginfo__new_online_kernel(unsigned long addr __unused)
+{
+ return NULL;
+}
+
+static inline void debuginfo__delete(struct debuginfo *self __unused)
+{
+ return;
+}
+
+static inline int debuginfo__find_trace_events(struct debuginfo *self __unused,
+ struct perf_probe_event *pev __unused,
+ struct probe_trace_event **tevs __unused,
+ int max_tevs __unused)
+{
+ return -ENOTSUP;
+}
+
+/* Find a perf_probe_point from debuginfo */
+static inline int debuginfo__find_probe_point(struct debuginfo *self __unused,
+ unsigned long addr __unused,
+ struct perf_probe_point *ppt __unused)
+{
+ return -ENOTSUP;
+}
+
+/* Find a line range */
+static inline int debuginfo__find_line_range(struct debuginfo *self __unused,
+ struct line_range *lr __unused)
+{
+ return -ENOTSUP;
+}
+/* Find available variables */
+static inline int debuginfo__find_available_vars_at(
+ struct debuginfo *self __unused,
+ struct perf_probe_event *pev __unused,
+ struct variable_list **vls __unused,
+ int max_points __unused,
+ bool externs __unused)
+{
+ return -ENOTSUP;
+}
+
#endif /* DWARF_SUPPORT */

#endif /*_PROBE_FINDER_H */

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/