diff options
author | Steven Rostedt <srostedt@redhat.com> | 2010-02-11 11:14:03 -0500 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2010-02-11 11:14:03 -0500 |
commit | 4dca43ba53304efc776116a220c634d887866ec9 (patch) | |
tree | b4b301b345e01d607179dd8364a855112268bca9 | |
parent | ef9f0772f8d02565b70bfc580cdefd003b58a1b4 (diff) |
kernelshark/trace-graph: Free up graph info
Have kernelshark call the graph info destructor.
Have the graph info destructor free the lists.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r-- | kernel-shark.c | 1 | ||||
-rw-r--r-- | trace-graph.c | 10 |
2 files changed, 6 insertions, 5 deletions
diff --git a/kernel-shark.c b/kernel-shark.c index 50e2659..784cb99 100644 --- a/kernel-shark.c +++ b/kernel-shark.c | |||
@@ -116,6 +116,7 @@ static void ks_graph_filter(struct graph_info *ginfo, | |||
116 | static void free_info(struct shark_info *info) | 116 | static void free_info(struct shark_info *info) |
117 | { | 117 | { |
118 | tracecmd_close(info->handle); | 118 | tracecmd_close(info->handle); |
119 | trace_graph_free_info(info->ginfo); | ||
119 | free(info->ginfo); | 120 | free(info->ginfo); |
120 | free(info); | 121 | free(info); |
121 | } | 122 | } |
diff --git a/trace-graph.c b/trace-graph.c index 7797210..3440497 100644 --- a/trace-graph.c +++ b/trace-graph.c | |||
@@ -2039,7 +2039,10 @@ create_graph_info(struct graph_info *ginfo) | |||
2039 | 2039 | ||
2040 | void trace_graph_free_info(struct graph_info *ginfo) | 2040 | void trace_graph_free_info(struct graph_info *ginfo) |
2041 | { | 2041 | { |
2042 | tracecmd_close(ginfo->handle); | 2042 | if (ginfo->handle) { |
2043 | trace_graph_plot_free(ginfo); | ||
2044 | tracecmd_close(ginfo->handle); | ||
2045 | } | ||
2043 | ginfo->handle = NULL; | 2046 | ginfo->handle = NULL; |
2044 | } | 2047 | } |
2045 | 2048 | ||
@@ -2053,11 +2056,8 @@ static int load_handle(struct graph_info *ginfo, | |||
2053 | if (!handle) | 2056 | if (!handle) |
2054 | return -1; | 2057 | return -1; |
2055 | 2058 | ||
2056 | trace_graph_plot_free(ginfo); | ||
2057 | trace_graph_plot_init(ginfo); | 2059 | trace_graph_plot_init(ginfo); |
2058 | 2060 | trace_graph_free_info(ginfo); | |
2059 | if (ginfo->handle) | ||
2060 | trace_graph_free_info(ginfo); | ||
2061 | 2061 | ||
2062 | ginfo->handle = handle; | 2062 | ginfo->handle = handle; |
2063 | tracecmd_ref(handle); | 2063 | tracecmd_ref(handle); |