tools lib api fs tracing_path: Introduce opendir() method
[sfrench/cifs-2.6.git] / tools / lib / api / fs / tracing_path.c
index 9cd28242592983b4b63f91e9b3f8d0bf7086718a..9b451af0721ccc59383ec6656298e14f13b5182e 100644 (file)
@@ -101,6 +101,19 @@ void put_events_file(char *file)
        free(file);
 }
 
+DIR *tracing_events__opendir(void)
+{
+       DIR *dir = NULL;
+       char *path = get_tracing_file("events");
+
+       if (path) {
+               dir = opendir(path);
+               put_events_file(path);
+       }
+
+       return dir;
+}
+
 int tracing_path__strerror_open_tp(int err, char *buf, size_t size,
                                   const char *sys, const char *name)
 {