ctf.fs source: use last path parameter's element as base for trace names
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Mon, 29 May 2017 23:55:16 +0000 (19:55 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 9 Jun 2017 20:58:12 +0000 (16:58 -0400)
commit4bd72b60e2b236ef91b7dcb577777bab87d0fdc8
treefb272f171553f8da10afa6d6709770649097223d
parent6eecdc5fbd217fbc744e6ff91e9b374005e78f1b
ctf.fs source: use last path parameter's element as base for trace names

Without this patch:

    Trace directory:  /home/user/my-traces/trace/yes/kernel
    `path` parameter: /home/user/my-traces/trace
    Trace name:                                      kernel

With this patch:

    Trace directory:  /home/user/my-traces/trace/yes/kernel
    `path` parameter: /home/user/my-traces/trace
    Trace name:                            trace/yes/kernel

This takes into account absolute vs. relative paths, resolves `..` and
`.`, and more. Most of the job is done by bt_common_normalize_path().
The process used to craft the trace names using the base directory as
passed by the user is really easy once all the paths are known to be
normalized.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
plugins/ctf/fs-src/fs.c
This page took 0.02409 seconds and 4 git commands to generate.