perf tools: Ditch rtrim(), use strim() from tools/lib
[linux-2.6-microblaze.git] / tools / perf / ui / browsers / hists.c
index 3421ecb..33e67aa 100644 (file)
@@ -6,6 +6,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <linux/rbtree.h>
+#include <linux/string.h>
 #include <sys/ttydefaults.h>
 #include <linux/time64.h>
 
@@ -33,7 +34,7 @@
 #include "units.h"
 #include "time-utils.h"
 
-#include "sane_ctype.h"
+#include <linux/ctype.h>
 
 extern void hist_browser__init_hpp(void);
 
@@ -1470,7 +1471,7 @@ static int hist_browser__show_hierarchy_entry(struct hist_browser *browser,
                                int i = 0;
 
                                width -= fmt->entry(fmt, &hpp, entry);
-                               ui_browser__printf(&browser->b, "%s", ltrim(s));
+                               ui_browser__printf(&browser->b, "%s", skip_spaces(s));
 
                                while (isspace(s[i++]))
                                        width++;
@@ -1686,7 +1687,7 @@ static int hists_browser__scnprintf_hierarchy_headers(struct hist_browser *brows
                        ret = fmt->header(fmt, &dummy_hpp, hists, 0, NULL);
                        dummy_hpp.buf[ret] = '\0';
 
-                       start = trim(dummy_hpp.buf);
+                       start = strim(dummy_hpp.buf);
                        ret = strlen(start);
 
                        if (start != dummy_hpp.buf)
@@ -2070,7 +2071,8 @@ static int hist_browser__fprintf_hierarchy_entry(struct hist_browser *browser,
                advance_hpp(&hpp, ret);
        }
 
-       printed += fprintf(fp, "%s\n", rtrim(s));
+       strim(s);
+       printed += fprintf(fp, "%s\n", s);
 
        if (he->leaf && folded_sign == '-') {
                printed += hist_browser__fprintf_callchain(browser, he, fp,