aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/symbol.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2010-04-27 20:22:44 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2010-04-27 20:22:44 -0400
commitcbf6968098f89d3216d074f06544b5032b344da4 (patch)
tree842750b609ec0ad6f246be03fc39f7614c98316f /tools/perf/util/symbol.c
parentd28c62232e50eab202bcd3f19b5c7a25b8b900b6 (diff)
perf machines: Make the machines class adopt the dsos__fprintf methods
Now those methods don't operate on a global list of dsos, but on lists of machines, so make this clear by renaming the functions. Cc: Avi Kivity <avi@redhat.com> Cc: Frédéric Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Zhang, Yanmin <yanmin_zhang@linux.intel.com> LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/symbol.c')
-rw-r--r--tools/perf/util/symbol.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 12359c37240c..caa890f8e2c0 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -1889,26 +1889,32 @@ struct dso *__dsos__findnew(struct list_head *head, const char *name)
1889 return dso; 1889 return dso;
1890} 1890}
1891 1891
1892static void __dsos__fprintf(struct list_head *head, FILE *fp) 1892static size_t __dsos__fprintf(struct list_head *head, FILE *fp)
1893{ 1893{
1894 struct dso *pos; 1894 struct dso *pos;
1895 size_t ret = 0;
1895 1896
1896 list_for_each_entry(pos, head, node) { 1897 list_for_each_entry(pos, head, node) {
1897 int i; 1898 int i;
1898 for (i = 0; i < MAP__NR_TYPES; ++i) 1899 for (i = 0; i < MAP__NR_TYPES; ++i)
1899 dso__fprintf(pos, i, fp); 1900 ret += dso__fprintf(pos, i, fp);
1900 } 1901 }
1902
1903 return ret;
1901} 1904}
1902 1905
1903void dsos__fprintf(struct rb_root *machines, FILE *fp) 1906size_t machines__fprintf_dsos(struct rb_root *self, FILE *fp)
1904{ 1907{
1905 struct rb_node *nd; 1908 struct rb_node *nd;
1909 size_t ret = 0;
1906 1910
1907 for (nd = rb_first(machines); nd; nd = rb_next(nd)) { 1911 for (nd = rb_first(self); nd; nd = rb_next(nd)) {
1908 struct machine *pos = rb_entry(nd, struct machine, rb_node); 1912 struct machine *pos = rb_entry(nd, struct machine, rb_node);
1909 __dsos__fprintf(&pos->kernel_dsos, fp); 1913 ret += __dsos__fprintf(&pos->kernel_dsos, fp);
1910 __dsos__fprintf(&pos->user_dsos, fp); 1914 ret += __dsos__fprintf(&pos->user_dsos, fp);
1911 } 1915 }
1916
1917 return ret;
1912} 1918}
1913 1919
1914static size_t __dsos__fprintf_buildid(struct list_head *head, FILE *fp, 1920static size_t __dsos__fprintf_buildid(struct list_head *head, FILE *fp,
@@ -1926,12 +1932,12 @@ static size_t __dsos__fprintf_buildid(struct list_head *head, FILE *fp,
1926 return ret; 1932 return ret;
1927} 1933}
1928 1934
1929size_t dsos__fprintf_buildid(struct rb_root *machines, FILE *fp, bool with_hits) 1935size_t machines__fprintf_dsos_buildid(struct rb_root *self, FILE *fp, bool with_hits)
1930{ 1936{
1931 struct rb_node *nd; 1937 struct rb_node *nd;
1932 size_t ret = 0; 1938 size_t ret = 0;
1933 1939
1934 for (nd = rb_first(machines); nd; nd = rb_next(nd)) { 1940 for (nd = rb_first(self); nd; nd = rb_next(nd)) {
1935 struct machine *pos = rb_entry(nd, struct machine, rb_node); 1941 struct machine *pos = rb_entry(nd, struct machine, rb_node);
1936 ret += __dsos__fprintf_buildid(&pos->kernel_dsos, fp, with_hits); 1942 ret += __dsos__fprintf_buildid(&pos->kernel_dsos, fp, with_hits);
1937 ret += __dsos__fprintf_buildid(&pos->user_dsos, fp, with_hits); 1943 ret += __dsos__fprintf_buildid(&pos->user_dsos, fp, with_hits);