]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - tools/perf/builtin-record.c
Merge tag 'fixes-nc-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm...
[karo-tx-linux.git] / tools / perf / builtin-record.c
index 88600158400ef005d471eaa6d53789600275a9d3..3c394bf16fa8cd86ce01d3d5852bab8a078f5ae4 100644 (file)
@@ -499,7 +499,7 @@ static int __cmd_record(struct record *rec, int argc, const char **argv)
         * (apart from group members) have enable_on_exec=1 set,
         * so don't spoil it by prematurely enabling them.
         */
-       if (!target__none(&opts->target))
+       if (!target__none(&opts->target) && !opts->initial_delay)
                perf_evlist__enable(rec->evlist);
 
        /*
@@ -508,6 +508,11 @@ static int __cmd_record(struct record *rec, int argc, const char **argv)
        if (forks)
                perf_evlist__start_workload(rec->evlist);
 
+       if (opts->initial_delay) {
+               usleep(opts->initial_delay * 1000);
+               perf_evlist__enable(rec->evlist);
+       }
+
        for (;;) {
                int hits = rec->samples;
 
@@ -833,7 +838,7 @@ const struct option record_options[] = {
                    "record events on existing thread id"),
        OPT_INTEGER('r', "realtime", &record.realtime_prio,
                    "collect data with this RT SCHED_FIFO priority"),
-       OPT_BOOLEAN('D', "no-delay", &record.opts.no_delay,
+       OPT_BOOLEAN(0, "no-buffering", &record.opts.no_buffering,
                    "collect data without buffering"),
        OPT_BOOLEAN('R', "raw-samples", &record.opts.raw_samples,
                    "collect raw sample records from all opened counters"),
@@ -877,6 +882,8 @@ const struct option record_options[] = {
        OPT_CALLBACK('G', "cgroup", &record.evlist, "name",
                     "monitor event in cgroup name only",
                     parse_cgroups),
+       OPT_UINTEGER('D', "delay", &record.opts.initial_delay,
+                 "ms to wait before starting measurement after program start"),
        OPT_STRING('u', "uid", &record.opts.target.uid_str, "user",
                   "user to profile"),