Skip to content

Commit

Permalink
perf record: Move machine variable down the function
Browse files Browse the repository at this point in the history
It's used far more down to be declared on the top of the __cmd_record.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20180307155020.32613-4-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
  • Loading branch information
Jiri Olsa authored and Arnaldo Carvalho de Melo committed Mar 8, 2018
1 parent e971a5a commit 20a8a3c
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions tools/perf/builtin-record.c
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,6 @@ static int __cmd_record(struct record *rec, int argc, const char **argv)
int status = 0;
unsigned long waking = 0;
const bool forks = argc > 0;
struct machine *machine;
struct perf_tool *tool = &rec->tool;
struct record_opts *opts = &rec->opts;
struct perf_data *data = &rec->data;
Expand Down Expand Up @@ -959,8 +958,6 @@ static int __cmd_record(struct record *rec, int argc, const char **argv)
goto out_child;
}

machine = &session->machines.host;

err = record__synthesize(rec, false);
if (err < 0)
goto out_child;
Expand Down Expand Up @@ -988,6 +985,7 @@ static int __cmd_record(struct record *rec, int argc, const char **argv)
* Let the child rip
*/
if (forks) {
struct machine *machine = &session->machines.host;
union perf_event *event;
pid_t tgid;

Expand Down

0 comments on commit 20a8a3c

Please sign in to comment.