lkml.org 
[lkml]   [2016]   [Feb]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 25/46] perf record: Force enable --timestamp-filename when --switch-output is provided
    Date
    Without this patch, the last output doesn't have timestamp appended if
    --timestamp-filename is not explicitly provided. For example:

    # perf record -a --switch-output &
    [1] 11224
    # kill -s SIGUSR2 11224
    [ perf record: dump data: Woken up 1 times ]
    # [ perf record: Dump perf.data.2015122622372823 ]

    # fg
    perf record -a --switch-output
    ^C[ perf record: Woken up 1 times to write data ]
    [ perf record: Captured and wrote 0.027 MB perf.data (540 samples) ]

    # ls -l
    total 836
    -rw------- 1 root root 33256 Dec 26 22:37 perf.data <---- *Odd*
    -rw------- 1 root root 817156 Dec 26 22:37 perf.data.2015122622372823

    Signed-off-by: Wang Nan <wangnan0@huawei.com>
    Signed-off-by: He Kuang <hekuang@huawei.com>
    Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
    Cc: Jiri Olsa <jolsa@kernel.org>
    Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Cc: Zefan Li <lizefan@huawei.com>
    Cc: pi3orama@163.com
    ---
    tools/perf/builtin-record.c | 3 +++
    1 file changed, 3 insertions(+)

    diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
    index 897d720..0092e54 100644
    --- a/tools/perf/builtin-record.c
    +++ b/tools/perf/builtin-record.c
    @@ -1349,6 +1349,9 @@ int cmd_record(int argc, const char **argv, const char *prefix __maybe_unused)
    return -EINVAL;
    }

    + if (rec->switch_output)
    + rec->timestamp_filename = true;
    +
    if (!rec->itr) {
    rec->itr = auxtrace_record__init(rec->evlist, &err);
    if (err)
    --
    1.8.3.4
    \
     
     \ /
      Last update: 2016-02-26 11:21    [W:4.047 / U:0.216 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site