[Pdbg] [PATCH v2 01/10] main: Move device_node setting before parse_options
Amitay Isaacs
amitay at ozlabs.org
Fri Nov 23 15:40:10 AEDT 2018
Parsing -l options requires device_node to be set. It is used in
pir_map() to map Linux CPU to proc/core/thread.
Signed-off-by: Amitay Isaacs <amitay at ozlabs.org>
---
src/main.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/main.c b/src/main.c
index 961d850..45ecd6a 100644
--- a/src/main.c
+++ b/src/main.c
@@ -502,6 +502,9 @@ static bool parse_options(int argc, char *argv[])
if (l_count) {
int pir = -1, i, chip, core, thread;
+ if (!device_node)
+ return false;
+
for (i = 0; i < MAX_LINUX_CPUS; i++) {
if (l_list[i] == 1) {
pir = get_pir(i);
@@ -730,6 +733,9 @@ int main(int argc, char *argv[])
backend = default_backend();
+ if (!device_node)
+ device_node = default_target(backend);
+
if (!parse_options(argc, argv))
return 1;
@@ -738,9 +744,6 @@ int main(int argc, char *argv[])
return 1;
}
- if (!device_node)
- device_node = default_target(backend);
-
/* Disable unselected targets */
if (!target_selection())
return 1;
--
2.19.1
More information about the Pdbg
mailing list