Jiri Olsa
b01c1f69c8
perf tools: Restore proper cwd on return from mnt namespace
...
When reporting on 'record' server we try to retrieve/use the mnt
namespace of the profiled tasks. We use following API with cookie to
hold the return namespace, roughly:
nsinfo__mountns_enter(struct nsinfo *nsi, struct nscookie *nc)
setns(newns, 0);
...
new ns related open..
...
nsinfo__mountns_exit(struct nscookie *nc)
setns(nc->oldns)
Once finished we setns to old namespace, which also sets the current
working directory (cwd) to "/", trashing the cwd we had.
This is mostly fine, because we use absolute paths almost everywhere,
but it screws up 'perf diff':
# perf diff
failed to open perf.data: No such file or directory (try 'perf record' first)
...
Adding the current working directory to be part of the cookie and
restoring it in the nsinfo__mountns_exit call.
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Krister Johansen <kjlx@templeofstupid.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Fixes: 843ff37bb59e ("perf symbols: Find symbols in different mount namespace")
Link: http://lkml.kernel.org/r/20181101170001.30019-1-jolsa@kernel.org
[ No need to check for NULL args for free(), use zfree() for struct members ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2018-11-19 12:12:26 -08:00
..
2018-06-25 11:59:37 -03:00
2018-07-31 10:57:56 -03:00
2017-11-02 11:10:55 +01:00
2018-11-05 14:53:54 -03:00
2017-11-02 11:10:55 +01:00
2018-09-19 17:17:44 -03:00
2018-10-18 11:16:38 -03:00
2018-08-30 15:51:54 -03:00
2018-01-17 10:23:31 -03:00
2018-01-17 10:23:31 -03:00
2018-01-17 10:23:31 -03:00
2018-01-17 10:23:31 -03:00
2018-10-24 15:29:54 -03:00
2018-10-24 15:29:54 -03:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-09-19 10:25:09 -03:00
2018-08-08 15:55:58 -03:00
2018-06-15 18:10:01 -03:00
2017-11-02 11:10:55 +01:00
2017-07-18 23:14:40 -03:00
2017-07-25 22:46:35 -03:00
2018-11-19 12:12:17 -08:00
2018-04-26 13:47:08 -03:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2016-05-06 13:00:43 -03:00
2016-05-06 13:00:43 -03:00
2018-01-17 10:23:32 -03:00
2018-01-17 10:23:32 -03:00
2018-06-04 10:28:50 -03:00
2018-03-07 10:22:26 -03:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-07-24 14:54:03 -03:00
2017-11-02 11:10:55 +01:00
2018-08-20 08:54:59 -03:00
2018-05-16 16:11:09 -03:00
2018-05-16 16:11:09 -03:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-10-31 09:57:50 -03:00
2018-04-19 12:29:41 -03:00
2017-11-02 11:10:55 +01:00
2018-09-19 17:14:13 -03:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-01-23 09:48:20 -03:00
2017-11-07 10:30:18 +01:00
2018-09-20 11:10:25 -03:00
2016-05-06 13:00:53 -03:00
2018-03-16 16:39:02 -03:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-04-19 13:01:51 -03:00
2016-09-22 12:19:41 -03:00
2018-08-20 08:54:59 -03:00
2018-08-20 08:54:59 -03:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-04-02 13:50:24 -03:00
2016-09-29 11:17:08 -03:00
2017-11-02 11:10:55 +01:00
2018-05-22 10:52:49 -03:00
2018-10-18 11:16:38 -03:00
2018-10-31 10:18:01 -03:00
2018-05-23 10:26:39 -03:00
2018-11-05 14:37:09 -03:00
2018-11-05 14:37:09 -03:00
2018-09-19 17:13:15 -03:00
2018-11-12 08:37:49 -08:00
2018-10-22 14:27:12 -03:00
2017-11-02 11:10:55 +01:00
2017-08-22 12:19:08 -03:00
2017-11-02 11:10:55 +01:00
2017-06-19 15:27:07 -03:00
2018-04-30 12:02:03 -03:00
2018-10-18 11:16:38 -03:00
2018-04-12 10:33:31 -03:00
2018-11-19 12:12:17 -08:00
2017-11-02 11:10:55 +01:00
2018-10-18 11:16:38 -03:00
2018-10-18 11:16:38 -03:00
2017-11-02 11:10:55 +01:00
2015-12-14 12:30:37 -03:00
2018-06-07 14:42:27 -03:00
2018-07-24 14:37:33 -03:00
2018-10-31 12:56:26 -03:00
2015-08-21 11:34:10 -03:00
2018-11-05 14:53:37 -03:00
2016-09-29 11:17:05 -03:00
2017-11-02 11:10:55 +01:00
2017-11-07 10:30:18 +01:00
2017-11-07 10:30:18 +01:00
2016-10-24 11:07:39 -03:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-08-30 15:52:20 -03:00
2018-08-20 08:54:58 -03:00
2018-08-20 08:54:59 -03:00
2018-10-31 10:18:01 -03:00
2018-08-13 15:22:10 -03:00
2018-09-18 17:20:41 -03:00
2018-08-08 15:56:00 -03:00
2018-03-16 13:52:37 -03:00
2018-03-16 13:52:37 -03:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-07-31 11:35:44 -03:00
2018-07-24 14:49:37 -03:00
2018-09-19 10:25:11 -03:00
2018-10-24 06:47:44 +01:00
2018-11-19 12:12:26 -08:00
2018-11-19 12:12:26 -08:00
2018-09-19 10:25:08 -03:00
2018-09-19 10:24:57 -03:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-10-19 16:31:09 -03:00
2018-10-19 16:31:09 -03:00
2018-10-19 16:31:09 -03:00
2018-06-07 15:50:14 -03:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-12-27 12:15:48 -03:00
2017-12-27 12:15:48 -03:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2016-11-29 12:13:27 -03:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-11-05 14:37:10 -03:00
2017-12-05 10:24:33 -03:00
2017-11-07 10:30:18 +01:00
2017-11-07 10:30:18 +01:00
2018-09-24 04:44:54 -04:00
2018-09-24 04:44:54 -04:00
2018-09-24 04:44:54 -04:00
2018-09-24 04:44:54 -04:00
2018-03-19 13:51:53 -03:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-12-27 12:15:56 -03:00
2018-09-19 17:14:13 -03:00
2017-11-07 10:30:18 +01:00
2017-12-05 10:24:31 -03:00
2017-12-05 10:24:31 -03:00
2018-03-05 11:52:41 -03:00
2017-09-21 13:28:06 -03:00
2017-09-21 13:28:06 -03:00
2018-08-08 15:26:48 -03:00
2018-08-30 15:52:20 -03:00
2018-08-03 10:34:18 -03:00
2017-11-02 11:10:55 +01:00
2018-09-19 10:25:10 -03:00
2018-09-19 10:25:10 -03:00
2017-07-18 23:14:08 -03:00
2018-10-08 14:30:45 -03:00
2017-08-22 12:09:04 -03:00
2017-08-22 12:09:04 -03:00
2018-09-19 17:14:13 -03:00
2018-08-10 15:29:35 -03:00
2018-10-16 14:52:21 -03:00
2018-01-08 11:11:57 -03:00
2018-08-30 15:52:25 -03:00
2018-08-30 15:52:23 -03:00
2018-09-19 10:25:10 -03:00
2018-09-19 10:25:10 -03:00
2018-10-08 14:23:44 -03:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-12-27 12:15:55 -03:00
2017-12-27 12:15:55 -03:00
2017-04-24 13:43:33 -03:00
2017-11-02 11:10:55 +01:00
2016-08-23 15:37:33 -03:00
2017-11-02 11:10:55 +01:00
2018-04-27 10:47:06 -03:00
2018-11-03 18:13:43 -07:00
2018-04-27 10:47:06 -03:00
2018-06-06 12:52:09 -03:00
2018-11-03 18:13:43 -07:00
2018-07-24 14:53:01 -03:00
2017-11-02 11:10:55 +01:00
2016-07-29 11:54:35 -03:00
2017-12-27 12:15:47 -03:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-02-27 11:29:21 -03:00
2018-02-27 11:29:21 -03:00
2018-10-31 12:54:27 -03:00
2018-10-31 12:54:27 -03:00
2018-10-31 10:18:01 -03:00
2018-10-31 10:18:01 -03:00
2018-01-17 10:23:36 -03:00
2018-01-17 10:23:36 -03:00
2018-09-19 10:25:10 -03:00
2018-06-04 10:28:52 -03:00
2018-10-08 14:23:45 -03:00
2018-10-08 15:05:37 -03:00
2018-10-08 15:05:37 -03:00
2018-08-10 15:29:35 -03:00
2018-09-19 17:11:50 -03:00
2018-09-19 17:29:26 -03:00
2018-03-06 11:31:14 -03:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-10-31 09:57:50 -03:00
2017-11-02 11:10:55 +01:00
2018-07-24 14:53:11 -03:00
2017-12-27 12:15:52 -03:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-09-19 10:25:12 -03:00
2018-11-19 12:12:17 -08:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-04-26 13:47:15 -03:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-08-20 08:54:59 -03:00