|
@@ -217,6 +217,29 @@ struct tracepoint_path *tracepoint_id_to_path(u64 config)
|
|
|
return NULL;
|
|
|
}
|
|
|
|
|
|
+struct tracepoint_path *tracepoint_name_to_path(const char *name)
|
|
|
+{
|
|
|
+ struct tracepoint_path *path = zalloc(sizeof(*path));
|
|
|
+ char *str = strchr(name, ':');
|
|
|
+
|
|
|
+ if (path == NULL || str == NULL) {
|
|
|
+ free(path);
|
|
|
+ return NULL;
|
|
|
+ }
|
|
|
+
|
|
|
+ path->system = strndup(name, str - name);
|
|
|
+ path->name = strdup(str+1);
|
|
|
+
|
|
|
+ if (path->system == NULL || path->name == NULL) {
|
|
|
+ free(path->system);
|
|
|
+ free(path->name);
|
|
|
+ free(path);
|
|
|
+ path = NULL;
|
|
|
+ }
|
|
|
+
|
|
|
+ return path;
|
|
|
+}
|
|
|
+
|
|
|
const char *event_type(int type)
|
|
|
{
|
|
|
switch (type) {
|