Message ID | 20191003041909.23187-20-amitay@ozlabs.org |
---|---|
State | Accepted |
Headers | show |
Series | Add system device tree to libpdbg | expand |
Context | Check | Description |
---|---|---|
snowpatch_ozlabs/apply_patch | success | Successfully applied on branch master (8a10a05c89db666bf98734139334166da7c370a4) |
snowpatch_ozlabs/build-multiarch | success | Test build-multiarch on branch master |
Reviewed-by: Alistair Popple <alistair@popple.id.au> On Thursday, 3 October 2019 2:18:58 PM AEDT Amitay Isaacs wrote: > Signed-off-by: Amitay Isaacs <amitay@ozlabs.org> > --- > fake.dts.m4 | 68 +++++++----- > src/tests/libpdbg_probe_test.c | 13 +++ > src/tests/libpdbg_target_test.c | 50 ++++++--- > tests/test_selection.sh | 98 +++++++++++++++--- > tests/test_selection2.sh | 178 +++++++++++++++++++++++++++++--- > 5 files changed, 335 insertions(+), 72 deletions(-) > > diff --git a/fake.dts.m4 b/fake.dts.m4 > index 92697df..a099154 100644 > --- a/fake.dts.m4 > +++ b/fake.dts.m4 > @@ -1,3 +1,5 @@ > +define(`CONCAT', `$1$2')dnl > + > dnl > dnl forloop([var], [start], [end], [iterator]) > dnl > @@ -47,55 +49,67 @@ forloop(`i', `0', eval(`$3-1'), `dump_thread(i)') > dump_core_post()') > > dnl > -dnl dump_processor_pre([index], [addr]) > +dnl dump_processor_pre([index]) > dnl > -define(`dump_processor_pre', > -` > - pib@$2 { > +define(`dump_processor_pre',`dnl > + pib { > #address-cells = <0x1>; > - #size-cells = <0x1>; > - compatible = "ibm,fake-pib"; > - reg = <0x$2 0x0>; > - index = <0x$1>;') > + #size-cells = <0x1>;') > > dnl > dnl dump_processor_post() > dnl > -define(`dump_processor_post', ` }; > +define(`dump_processor_post', ` }; > ')dnl > > dnl > -dnl dump_processor([index], [addr], [num_cores], [num_threads]) > +dnl dump_processor([index], [num_cores], [num_threads]) > dnl > define(`dump_processor',dnl > -`dump_processor_pre(`$1', `$2') > -forloop(`i', `0', eval(`$3-1'), `dump_core(i, eval(10000+(i+1)*10), $4)') > +`dump_processor_pre(`$1') > +forloop(`i', `0', eval(`$2-1'), `dump_core(i, eval(10000+(i+1)*10), $3)') > dump_processor_post()') > > dnl > -dnl dump_fsi_pre([index], [addr]) > +dnl dump_backend([index], [addr]) > dnl > -define(`dump_fsi_pre', > -` > +define(`dump_backend',dnl > +`define(`pib_addr', eval(`$2+100'))dnl > + > fsi@$2 { > #address-cells = <0x1>; > #size-cells = <0x1>; > compatible = "ibm,fake-fsi"; > - reg = <0x$2 0x0>; > - index = <0x$1>;') > + system-path = "/proc$1/fsi"; > + reg = <0x0 0x0>; > + index = <0x$1>; > + > + CONCAT(pib@,pib_addr) { > + #address-cells = <0x1>; > + #size-cells = <0x1>; > + compatible = "ibm,fake-pib"; > + system-path = "/proc$1/pib"; > + reg = <CONCAT(0x,pib_addr) 0x0>; > + index = <0x$1>; > + }; > + }; > + > +')dnl > > -dnl > -dnl dump_fsi_post() > -dnl > -define(`dump_fsi_post', ` };') > > dnl > -dnl dump_fsi([index], [addr], [num_processors], [num_cores], [num_threads]) > +dnl dump_system([num_processors], [num_cores], [num_threads]) > dnl > -define(`dump_fsi', > -`dump_fsi_pre(`$1', `$2') > -forloop(`i', `0', eval(`$3-1'), `dump_processor(i, eval(10000+i*1000), $4, $5)') > -dump_fsi_post()') > +define(`dump_system', > +`forloop(`i', `0', eval(`$1-1'), `dump_backend(i, eval(20000+i*1000))') > +forloop(`i', `0', eval(`$1-1'),dnl > +` > + CONCAT(proc,i) { > + index = < CONCAT(0x,i) >; > + > +dump_processor(i, $2, $3) > + }; > +')') > divert`'dnl > > /dts-v1/; > @@ -103,5 +117,5 @@ divert`'dnl > / { > #address-cells = <0x1>; > #size-cells = <0x1>; > -dump_fsi(0, 0, 8, 4, 2) > +dump_system(8, 4, 2) > }; > diff --git a/src/tests/libpdbg_probe_test.c b/src/tests/libpdbg_probe_test.c > index 8b78b2e..ed8a800 100644 > --- a/src/tests/libpdbg_probe_test.c > +++ b/src/tests/libpdbg_probe_test.c > @@ -129,6 +129,12 @@ static void test2(void) > > for_each_target(root, check_status, PDBG_TARGET_UNKNOWN); > > + pdbg_for_each_class_target("fsi", target) { > + status = pdbg_target_probe(target); > + assert(status == PDBG_TARGET_ENABLED); > + > + for_target_to_root(target, check_status, PDBG_TARGET_ENABLED); > + } > pdbg_for_each_class_target("pib", target) { > status = pdbg_target_probe(target); > assert(status == PDBG_TARGET_ENABLED); > @@ -172,6 +178,13 @@ static void test2(void) > check_status(target, PDBG_TARGET_RELEASED); > } > > + pdbg_for_each_class_target("pib", target) { > + pdbg_target_release(target); > + } > + pdbg_for_each_class_target("pib", target) { > + for_each_target(target, check_status, PDBG_TARGET_RELEASED); > + } > + > pdbg_for_each_class_target("fsi", target) { > pdbg_target_release(target); > } > diff --git a/src/tests/libpdbg_target_test.c b/src/tests/libpdbg_target_test.c > index 27efb56..9806281 100644 > --- a/src/tests/libpdbg_target_test.c > +++ b/src/tests/libpdbg_target_test.c > @@ -72,7 +72,7 @@ int main(void) > assert(root); > > count = count_class_target("fsi"); > - assert(count == 1); > + assert(count == 8); > > count = count_class_target("pib"); > assert(count == 8); > @@ -83,7 +83,28 @@ int main(void) > count = count_class_target("thread"); > assert(count == 64); > > + pdbg_for_each_child_target(root, parent) { > + name = pdbg_target_dn_name(parent); > + assert(strncmp(name, "proc", 4) == 0); > + > + pdbg_for_each_target("pib", parent, target) { > + name = pdbg_target_class_name(target); > + assert(!strcmp(name, "pib")); > + } > + > + pdbg_for_each_target("fsi", parent, target) { > + name = pdbg_target_class_name(target); > + assert(!strcmp(name, "fsi")); > + } > + }; > + > pdbg_for_each_class_target("fsi", target) { > + parent = pdbg_target_parent(NULL, target); > + assert(parent); > + > + name = pdbg_target_dn_name(parent); > + assert(strncmp(name, "proc", 4) == 0); > + > parent = pdbg_target_parent("fsi", target); > assert(parent == NULL); > > @@ -97,19 +118,19 @@ int main(void) > assert(parent == NULL); > > count = count_child_target(target); > - assert(count == 8); > + assert(count == 0); > > count = count_target(target, "fsi"); > assert(count == 1); > > count = count_target(target, "pib"); > - assert(count == 8); > + assert(count == 0); > > count = count_target(target, "core"); > - assert(count == 32); > + assert(count == 0); > > count = count_target(target, "thread"); > - assert(count == 64); > + assert(count == 0); > > name = pdbg_target_name(target); > assert(!strcmp(name, "Fake FSI")); > @@ -122,11 +143,14 @@ int main(void) > } > > pdbg_for_each_class_target("pib", target) { > - parent = pdbg_target_parent("fsi", target); > + parent = pdbg_target_parent(NULL, target); > assert(parent); > > - parent2 = pdbg_target_require_parent("fsi", target); > - assert(parent == parent2); > + name = pdbg_target_dn_name(parent); > + assert(strncmp(name, "proc", 4) == 0); > + > + parent = pdbg_target_parent("fsi", target); > + assert(parent == NULL); > > parent = pdbg_target_parent("pib", target); > assert(parent == NULL); > @@ -167,10 +191,7 @@ int main(void) > uint32_t index; > > parent = pdbg_target_parent("fsi", target); > - assert(parent); > - > - parent2 = pdbg_target_require_parent("fsi", target); > - assert(parent == parent2); > + assert(parent == NULL); > > parent = pdbg_target_parent("pib", target); > assert(parent); > @@ -216,10 +237,7 @@ int main(void) > > pdbg_for_each_class_target("thread", target) { > parent = pdbg_target_parent("fsi", target); > - assert(parent); > - > - parent2 = pdbg_target_require_parent("fsi", target); > - assert(parent == parent2); > + assert(parent == NULL); > > parent = pdbg_target_parent("pib", target); > assert(parent); > diff --git a/tests/test_selection.sh b/tests/test_selection.sh > index 50db9e4..0931051 100755 > --- a/tests/test_selection.sh > +++ b/tests/test_selection.sh > @@ -23,7 +23,8 @@ test_run pdbg -b fake probe > > > test_result 0 <<EOF > -fsi0: Fake FSI (*) > +proc0: > + fsi0: Fake FSI (*) > pib0: Fake PIB (*) > core0: Fake Core (*) > thread0: Fake Thread (*) > @@ -37,6 +38,8 @@ fsi0: Fake FSI (*) > core3: Fake Core (*) > thread0: Fake Thread (*) > thread1: Fake Thread (*) > +proc1: > + fsi1: Fake FSI (*) > pib1: Fake PIB (*) > core0: Fake Core (*) > thread0: Fake Thread (*) > @@ -50,6 +53,8 @@ fsi0: Fake FSI (*) > core3: Fake Core (*) > thread0: Fake Thread (*) > thread1: Fake Thread (*) > +proc2: > + fsi2: Fake FSI (*) > pib2: Fake PIB (*) > core0: Fake Core (*) > thread0: Fake Thread (*) > @@ -63,6 +68,8 @@ fsi0: Fake FSI (*) > core3: Fake Core (*) > thread0: Fake Thread (*) > thread1: Fake Thread (*) > +proc3: > + fsi3: Fake FSI (*) > pib3: Fake PIB (*) > core0: Fake Core (*) > thread0: Fake Thread (*) > @@ -76,6 +83,8 @@ fsi0: Fake FSI (*) > core3: Fake Core (*) > thread0: Fake Thread (*) > thread1: Fake Thread (*) > +proc4: > + fsi4: Fake FSI (*) > pib4: Fake PIB (*) > core0: Fake Core (*) > thread0: Fake Thread (*) > @@ -89,6 +98,8 @@ fsi0: Fake FSI (*) > core3: Fake Core (*) > thread0: Fake Thread (*) > thread1: Fake Thread (*) > +proc5: > + fsi5: Fake FSI (*) > pib5: Fake PIB (*) > core0: Fake Core (*) > thread0: Fake Thread (*) > @@ -102,6 +113,8 @@ fsi0: Fake FSI (*) > core3: Fake Core (*) > thread0: Fake Thread (*) > thread1: Fake Thread (*) > +proc6: > + fsi6: Fake FSI (*) > pib6: Fake PIB (*) > core0: Fake Core (*) > thread0: Fake Thread (*) > @@ -115,6 +128,8 @@ fsi0: Fake FSI (*) > core3: Fake Core (*) > thread0: Fake Thread (*) > thread1: Fake Thread (*) > +proc7: > + fsi7: Fake FSI (*) > pib7: Fake PIB (*) > core0: Fake Core (*) > thread0: Fake Thread (*) > @@ -135,7 +150,8 @@ test_run pdbg -b fake -a probe > > > test_result 0 <<EOF > -fsi0: Fake FSI (*) > +proc0: > + fsi0: Fake FSI (*) > pib0: Fake PIB (*) > core0: Fake Core (*) > thread0: Fake Thread (*) > @@ -156,35 +172,50 @@ test_run pdbg -b fake -p0 -a probe > > > test_result 0 <<EOF > -fsi0: Fake FSI (*) > +proc0: > + fsi0: Fake FSI (*) > pib0: Fake PIB (*) > core0: Fake Core (*) > thread0: Fake Thread (*) > thread1: Fake Thread (*) > +proc1: > + fsi1: Fake FSI (*) > pib1: Fake PIB (*) > core0: Fake Core (*) > thread0: Fake Thread (*) > thread1: Fake Thread (*) > +proc2: > + fsi2: Fake FSI (*) > pib2: Fake PIB (*) > core0: Fake Core (*) > thread0: Fake Thread (*) > thread1: Fake Thread (*) > +proc3: > + fsi3: Fake FSI (*) > pib3: Fake PIB (*) > core0: Fake Core (*) > thread0: Fake Thread (*) > thread1: Fake Thread (*) > +proc4: > + fsi4: Fake FSI (*) > pib4: Fake PIB (*) > core0: Fake Core (*) > thread0: Fake Thread (*) > thread1: Fake Thread (*) > +proc5: > + fsi5: Fake FSI (*) > pib5: Fake PIB (*) > core0: Fake Core (*) > thread0: Fake Thread (*) > thread1: Fake Thread (*) > +proc6: > + fsi6: Fake FSI (*) > pib6: Fake PIB (*) > core0: Fake Core (*) > thread0: Fake Thread (*) > thread1: Fake Thread (*) > +proc7: > + fsi7: Fake FSI (*) > pib7: Fake PIB (*) > core0: Fake Core (*) > thread0: Fake Thread (*) > @@ -196,7 +227,8 @@ test_run pdbg -b fake -c0 -a probe > > > test_result 0 <<EOF > -fsi0: Fake FSI (*) > +proc0: > + fsi0: Fake FSI (*) > pib0: Fake PIB (*) > core0: Fake Core (*) > thread0: Fake Thread (*) > @@ -206,6 +238,8 @@ fsi0: Fake FSI (*) > thread0: Fake Thread (*) > core3: Fake Core (*) > thread0: Fake Thread (*) > +proc1: > + fsi1: Fake FSI (*) > pib1: Fake PIB (*) > core0: Fake Core (*) > thread0: Fake Thread (*) > @@ -215,6 +249,8 @@ fsi0: Fake FSI (*) > thread0: Fake Thread (*) > core3: Fake Core (*) > thread0: Fake Thread (*) > +proc2: > + fsi2: Fake FSI (*) > pib2: Fake PIB (*) > core0: Fake Core (*) > thread0: Fake Thread (*) > @@ -224,6 +260,8 @@ fsi0: Fake FSI (*) > thread0: Fake Thread (*) > core3: Fake Core (*) > thread0: Fake Thread (*) > +proc3: > + fsi3: Fake FSI (*) > pib3: Fake PIB (*) > core0: Fake Core (*) > thread0: Fake Thread (*) > @@ -233,6 +271,8 @@ fsi0: Fake FSI (*) > thread0: Fake Thread (*) > core3: Fake Core (*) > thread0: Fake Thread (*) > +proc4: > + fsi4: Fake FSI (*) > pib4: Fake PIB (*) > core0: Fake Core (*) > thread0: Fake Thread (*) > @@ -242,6 +282,8 @@ fsi0: Fake FSI (*) > thread0: Fake Thread (*) > core3: Fake Core (*) > thread0: Fake Thread (*) > +proc5: > + fsi5: Fake FSI (*) > pib5: Fake PIB (*) > core0: Fake Core (*) > thread0: Fake Thread (*) > @@ -251,6 +293,8 @@ fsi0: Fake FSI (*) > thread0: Fake Thread (*) > core3: Fake Core (*) > thread0: Fake Thread (*) > +proc6: > + fsi6: Fake FSI (*) > pib6: Fake PIB (*) > core0: Fake Core (*) > thread0: Fake Thread (*) > @@ -260,6 +304,8 @@ fsi0: Fake FSI (*) > thread0: Fake Thread (*) > core3: Fake Core (*) > thread0: Fake Thread (*) > +proc7: > + fsi7: Fake FSI (*) > pib7: Fake PIB (*) > core0: Fake Core (*) > thread0: Fake Thread (*) > @@ -276,7 +322,8 @@ test_run pdbg -b fake -t0 -a probe > > > test_result 0 <<EOF > -fsi0: Fake FSI (*) > +proc0: > + fsi0: Fake FSI (*) > pib0: Fake PIB (*) > core2: Fake Core (*) > thread0: Fake Thread (*) > @@ -288,7 +335,8 @@ test_run pdbg -b fake -p0 -c2 -a probe > > > test_result 0 <<EOF > -fsi0: Fake FSI (*) > +proc0: > + fsi0: Fake FSI (*) > pib0: Fake PIB (*) > core2: Fake Core (*) > thread1: Fake Thread (*) > @@ -299,19 +347,28 @@ test_run pdbg -b fake -p0 -c2 -t1 -a probe > > > test_result 0 <<EOF > -fsi0: Fake FSI > +proc1: > + fsi1: Fake FSI (*) > pib1: Fake PIB (*) > core0: Fake Core (*) > thread0: Fake Thread (*) > +proc2: > + fsi2: Fake FSI (*) > pib2: Fake PIB (*) > core0: Fake Core (*) > thread0: Fake Thread (*) > +proc3: > + fsi3: Fake FSI (*) > pib3: Fake PIB (*) > core0: Fake Core (*) > thread0: Fake Thread (*) > +proc5: > + fsi5: Fake FSI (*) > pib5: Fake PIB (*) > core0: Fake Core (*) > thread0: Fake Thread (*) > +proc6: > + fsi6: Fake FSI (*) > pib6: Fake PIB (*) > core0: Fake Core (*) > thread0: Fake Thread (*) > @@ -322,7 +379,8 @@ test_run pdbg -b fake -p1-3,5,5-6 -c0 -t0 probe > > > test_result 0 <<EOF > -fsi0: Fake FSI (*) > +proc0: > + fsi0: Fake FSI (*) > pib0: Fake PIB (*) > EOF > > @@ -371,7 +429,8 @@ test_run pdbg -b fake -t0 -p0 probe > > > test_result 0 <<EOF > -fsi0: Fake FSI (*) > +proc0: > + fsi0: Fake FSI (*) > pib0: Fake PIB (*) > core0: Fake Core (*) > EOF > @@ -381,7 +440,8 @@ test_run pdbg -b fake -c0 -p0 probe > > > test_result 0 <<EOF > -fsi0: Fake FSI (*) > +proc0: > + fsi0: Fake FSI (*) > pib0: Fake PIB (*) > core0: Fake Core (*) > thread0: Fake Thread (*) > @@ -392,22 +452,29 @@ test_run pdbg -b fake -t0 -c0 -p0 probe > > > test_result 0 <<EOF > -fsi0: Fake FSI > +proc1: > + fsi1: Fake FSI (*) > pib1: Fake PIB (*) > core1: Fake Core (*) > thread0: Fake Thread (*) > core3: Fake Core (*) > thread0: Fake Thread (*) > +proc3: > + fsi3: Fake FSI (*) > pib3: Fake PIB (*) > core1: Fake Core (*) > thread0: Fake Thread (*) > core3: Fake Core (*) > thread0: Fake Thread (*) > +proc5: > + fsi5: Fake FSI (*) > pib5: Fake PIB (*) > core1: Fake Core (*) > thread0: Fake Thread (*) > core3: Fake Core (*) > thread0: Fake Thread (*) > +proc7: > + fsi7: Fake FSI (*) > pib7: Fake PIB (*) > core1: Fake Core (*) > thread0: Fake Thread (*) > @@ -420,22 +487,29 @@ test_run pdbg -b fake -p1,3,5,7,9 -c1,3,5 -t0,2 probe > > > test_result 0 <<EOF > -fsi0: Fake FSI > +proc1: > + fsi1: Fake FSI (*) > pib1: Fake PIB (*) > core1: Fake Core (*) > thread1: Fake Thread (*) > core3: Fake Core (*) > thread1: Fake Thread (*) > +proc3: > + fsi3: Fake FSI (*) > pib3: Fake PIB (*) > core1: Fake Core (*) > thread1: Fake Thread (*) > core3: Fake Core (*) > thread1: Fake Thread (*) > +proc5: > + fsi5: Fake FSI (*) > pib5: Fake PIB (*) > core1: Fake Core (*) > thread1: Fake Thread (*) > core3: Fake Core (*) > thread1: Fake Thread (*) > +proc7: > + fsi7: Fake FSI (*) > pib7: Fake PIB (*) > core1: Fake Core (*) > thread1: Fake Thread (*) > diff --git a/tests/test_selection2.sh b/tests/test_selection2.sh > index 6c0a50e..add51c0 100755 > --- a/tests/test_selection2.sh > +++ b/tests/test_selection2.sh > @@ -14,7 +14,8 @@ do_skip () > } > > test_result 0 <<EOF > -fsi0: Fake FSI > +proc0: > + fsi0: Fake FSI > pib0: Fake PIB > core0: Fake Core > thread0: Fake Thread (*) > @@ -28,6 +29,8 @@ fsi0: Fake FSI > core3: Fake Core > thread0: Fake Thread (*) > thread1: Fake Thread (*) > +proc1: > + fsi1: Fake FSI > pib1: Fake PIB > core0: Fake Core > thread0: Fake Thread (*) > @@ -41,6 +44,8 @@ fsi0: Fake FSI > core3: Fake Core > thread0: Fake Thread (*) > thread1: Fake Thread (*) > +proc2: > + fsi2: Fake FSI > pib2: Fake PIB > core0: Fake Core > thread0: Fake Thread (*) > @@ -54,6 +59,8 @@ fsi0: Fake FSI > core3: Fake Core > thread0: Fake Thread (*) > thread1: Fake Thread (*) > +proc3: > + fsi3: Fake FSI > pib3: Fake PIB > core0: Fake Core > thread0: Fake Thread (*) > @@ -67,6 +74,8 @@ fsi0: Fake FSI > core3: Fake Core > thread0: Fake Thread (*) > thread1: Fake Thread (*) > +proc4: > + fsi4: Fake FSI > pib4: Fake PIB > core0: Fake Core > thread0: Fake Thread (*) > @@ -80,6 +89,8 @@ fsi0: Fake FSI > core3: Fake Core > thread0: Fake Thread (*) > thread1: Fake Thread (*) > +proc5: > + fsi5: Fake FSI > pib5: Fake PIB > core0: Fake Core > thread0: Fake Thread (*) > @@ -93,6 +104,8 @@ fsi0: Fake FSI > core3: Fake Core > thread0: Fake Thread (*) > thread1: Fake Thread (*) > +proc6: > + fsi6: Fake FSI > pib6: Fake PIB > core0: Fake Core > thread0: Fake Thread (*) > @@ -106,6 +119,8 @@ fsi0: Fake FSI > core3: Fake Core > thread0: Fake Thread (*) > thread1: Fake Thread (*) > +proc7: > + fsi7: Fake FSI > pib7: Fake PIB > core0: Fake Core > thread0: Fake Thread (*) > @@ -126,7 +141,8 @@ test_run pdbg -b fake -P thread probe > > > test_result 0 <<EOF > -fsi0: Fake FSI > +proc0: > + fsi0: Fake FSI > pib0: Fake PIB > core0: Fake Core > thread0: Fake Thread (*) > @@ -147,35 +163,50 @@ test_run pdbg -b fake -P pib0/thread probe > > > test_result 0 <<EOF > -fsi0: Fake FSI > +proc0: > + fsi0: Fake FSI > pib0: Fake PIB > core0: Fake Core > thread0: Fake Thread (*) > thread1: Fake Thread (*) > +proc1: > + fsi1: Fake FSI > pib1: Fake PIB > core0: Fake Core > thread0: Fake Thread (*) > thread1: Fake Thread (*) > +proc2: > + fsi2: Fake FSI > pib2: Fake PIB > core0: Fake Core > thread0: Fake Thread (*) > thread1: Fake Thread (*) > +proc3: > + fsi3: Fake FSI > pib3: Fake PIB > core0: Fake Core > thread0: Fake Thread (*) > thread1: Fake Thread (*) > +proc4: > + fsi4: Fake FSI > pib4: Fake PIB > core0: Fake Core > thread0: Fake Thread (*) > thread1: Fake Thread (*) > +proc5: > + fsi5: Fake FSI > pib5: Fake PIB > core0: Fake Core > thread0: Fake Thread (*) > thread1: Fake Thread (*) > +proc6: > + fsi6: Fake FSI > pib6: Fake PIB > core0: Fake Core > thread0: Fake Thread (*) > thread1: Fake Thread (*) > +proc7: > + fsi7: Fake FSI > pib7: Fake PIB > core0: Fake Core > thread0: Fake Thread (*) > @@ -187,7 +218,8 @@ test_run pdbg -b fake -P core0/thread probe > > > test_result 0 <<EOF > -fsi0: Fake FSI > +proc0: > + fsi0: Fake FSI > pib0: Fake PIB > core0: Fake Core > thread0: Fake Thread (*) > @@ -197,6 +229,8 @@ fsi0: Fake FSI > thread0: Fake Thread (*) > core3: Fake Core > thread0: Fake Thread (*) > +proc1: > + fsi1: Fake FSI > pib1: Fake PIB > core0: Fake Core > thread0: Fake Thread (*) > @@ -206,6 +240,8 @@ fsi0: Fake FSI > thread0: Fake Thread (*) > core3: Fake Core > thread0: Fake Thread (*) > +proc2: > + fsi2: Fake FSI > pib2: Fake PIB > core0: Fake Core > thread0: Fake Thread (*) > @@ -215,6 +251,8 @@ fsi0: Fake FSI > thread0: Fake Thread (*) > core3: Fake Core > thread0: Fake Thread (*) > +proc3: > + fsi3: Fake FSI > pib3: Fake PIB > core0: Fake Core > thread0: Fake Thread (*) > @@ -224,6 +262,8 @@ fsi0: Fake FSI > thread0: Fake Thread (*) > core3: Fake Core > thread0: Fake Thread (*) > +proc4: > + fsi4: Fake FSI > pib4: Fake PIB > core0: Fake Core > thread0: Fake Thread (*) > @@ -233,6 +273,8 @@ fsi0: Fake FSI > thread0: Fake Thread (*) > core3: Fake Core > thread0: Fake Thread (*) > +proc5: > + fsi5: Fake FSI > pib5: Fake PIB > core0: Fake Core > thread0: Fake Thread (*) > @@ -242,6 +284,8 @@ fsi0: Fake FSI > thread0: Fake Thread (*) > core3: Fake Core > thread0: Fake Thread (*) > +proc6: > + fsi6: Fake FSI > pib6: Fake PIB > core0: Fake Core > thread0: Fake Thread (*) > @@ -251,6 +295,8 @@ fsi0: Fake FSI > thread0: Fake Thread (*) > core3: Fake Core > thread0: Fake Thread (*) > +proc7: > + fsi7: Fake FSI > pib7: Fake PIB > core0: Fake Core > thread0: Fake Thread (*) > @@ -267,7 +313,8 @@ test_run pdbg -b fake -P thread0 probe > > > test_result 0 <<EOF > -fsi0: Fake FSI > +proc0: > + fsi0: Fake FSI > pib0: Fake PIB > core2: Fake Core > thread0: Fake Thread (*) > @@ -279,7 +326,8 @@ test_run pdbg -b fake -P pib0/core2/thread probe > > > test_result 0 <<EOF > -fsi0: Fake FSI > +proc0: > + fsi0: Fake FSI > pib0: Fake PIB > core2: Fake Core > thread1: Fake Thread (*) > @@ -290,19 +338,28 @@ test_run pdbg -b fake -P pib0/core2/thread1 probe > > > test_result 0 <<EOF > -fsi0: Fake FSI > +proc1: > + fsi1: Fake FSI > pib1: Fake PIB > core0: Fake Core > thread0: Fake Thread (*) > +proc2: > + fsi2: Fake FSI > pib2: Fake PIB > core0: Fake Core > thread0: Fake Thread (*) > +proc3: > + fsi3: Fake FSI > pib3: Fake PIB > core0: Fake Core > thread0: Fake Thread (*) > +proc5: > + fsi5: Fake FSI > pib5: Fake PIB > core0: Fake Core > thread0: Fake Thread (*) > +proc6: > + fsi6: Fake FSI > pib6: Fake PIB > core0: Fake Core > thread0: Fake Thread (*) > @@ -313,7 +370,8 @@ test_run pdbg -b fake -P pib[1-3,5,5-6]/core0/thread0 probe > > > test_result 0 <<EOF > -fsi0: Fake FSI > +proc0: > + fsi0: Fake FSI > pib0: Fake PIB (*) > EOF > > @@ -322,21 +380,36 @@ test_run pdbg -b fake -P pib0 probe > > > test_result 0 <<EOF > -fsi0: Fake FSI > +proc0: > + fsi0: Fake FSI > pib0: Fake PIB > core0: Fake Core (*) > +proc1: > + fsi1: Fake FSI > pib1: Fake PIB > core0: Fake Core (*) > +proc2: > + fsi2: Fake FSI > pib2: Fake PIB > core0: Fake Core (*) > +proc3: > + fsi3: Fake FSI > pib3: Fake PIB > core0: Fake Core (*) > +proc4: > + fsi4: Fake FSI > pib4: Fake PIB > core0: Fake Core (*) > +proc5: > + fsi5: Fake FSI > pib5: Fake PIB > core0: Fake Core (*) > +proc6: > + fsi6: Fake FSI > pib6: Fake PIB > core0: Fake Core (*) > +proc7: > + fsi7: Fake FSI > pib7: Fake PIB > core0: Fake Core (*) > EOF > @@ -346,7 +419,8 @@ test_run pdbg -b fake -P core0 probe > > > test_result 0 <<EOF > -fsi0: Fake FSI > +proc0: > + fsi0: Fake FSI > pib0: Fake PIB > core0: Fake Core > thread0: Fake Thread (*) > @@ -356,6 +430,8 @@ fsi0: Fake FSI > thread0: Fake Thread (*) > core3: Fake Core > thread0: Fake Thread (*) > +proc1: > + fsi1: Fake FSI > pib1: Fake PIB > core0: Fake Core > thread0: Fake Thread (*) > @@ -365,6 +441,8 @@ fsi0: Fake FSI > thread0: Fake Thread (*) > core3: Fake Core > thread0: Fake Thread (*) > +proc2: > + fsi2: Fake FSI > pib2: Fake PIB > core0: Fake Core > thread0: Fake Thread (*) > @@ -374,6 +452,8 @@ fsi0: Fake FSI > thread0: Fake Thread (*) > core3: Fake Core > thread0: Fake Thread (*) > +proc3: > + fsi3: Fake FSI > pib3: Fake PIB > core0: Fake Core > thread0: Fake Thread (*) > @@ -383,6 +463,8 @@ fsi0: Fake FSI > thread0: Fake Thread (*) > core3: Fake Core > thread0: Fake Thread (*) > +proc4: > + fsi4: Fake FSI > pib4: Fake PIB > core0: Fake Core > thread0: Fake Thread (*) > @@ -392,6 +474,8 @@ fsi0: Fake FSI > thread0: Fake Thread (*) > core3: Fake Core > thread0: Fake Thread (*) > +proc5: > + fsi5: Fake FSI > pib5: Fake PIB > core0: Fake Core > thread0: Fake Thread (*) > @@ -401,6 +485,8 @@ fsi0: Fake FSI > thread0: Fake Thread (*) > core3: Fake Core > thread0: Fake Thread (*) > +proc6: > + fsi6: Fake FSI > pib6: Fake PIB > core0: Fake Core > thread0: Fake Thread (*) > @@ -410,6 +496,8 @@ fsi0: Fake FSI > thread0: Fake Thread (*) > core3: Fake Core > thread0: Fake Thread (*) > +proc7: > + fsi7: Fake FSI > pib7: Fake PIB > core0: Fake Core > thread0: Fake Thread (*) > @@ -426,28 +514,43 @@ test_run pdbg -b fake -P thread0 probe > > > test_result 0 <<EOF > -fsi0: Fake FSI > +proc0: > + fsi0: Fake FSI > pib0: Fake PIB > core0: Fake Core > thread0: Fake Thread (*) > +proc1: > + fsi1: Fake FSI > pib1: Fake PIB > core0: Fake Core > thread0: Fake Thread (*) > +proc2: > + fsi2: Fake FSI > pib2: Fake PIB > core0: Fake Core > thread0: Fake Thread (*) > +proc3: > + fsi3: Fake FSI > pib3: Fake PIB > core0: Fake Core > thread0: Fake Thread (*) > +proc4: > + fsi4: Fake FSI > pib4: Fake PIB > core0: Fake Core > thread0: Fake Thread (*) > +proc5: > + fsi5: Fake FSI > pib5: Fake PIB > core0: Fake Core > thread0: Fake Thread (*) > +proc6: > + fsi6: Fake FSI > pib6: Fake PIB > core0: Fake Core > thread0: Fake Thread (*) > +proc7: > + fsi7: Fake FSI > pib7: Fake PIB > core0: Fake Core > thread0: Fake Thread (*) > @@ -458,7 +561,8 @@ test_run pdbg -b fake -P core0/thread0 probe > > > test_result 0 <<EOF > -fsi0: Fake FSI > +proc0: > + fsi0: Fake FSI > pib0: Fake PIB > core0: Fake Core > thread0: Fake Thread (*) > @@ -475,7 +579,8 @@ test_run pdbg -b fake -P pib0/thread0 probe > > > test_result 0 <<EOF > -fsi0: Fake FSI > +proc0: > + fsi0: Fake FSI > pib0: Fake PIB > core0: Fake Core (*) > EOF > @@ -485,7 +590,8 @@ test_run pdbg -b fake -P pib0/core0 probe > > > test_result 0 <<EOF > -fsi0: Fake FSI > +proc0: > + fsi0: Fake FSI > pib0: Fake PIB > core0: Fake Core > thread0: Fake Thread (*) > @@ -496,22 +602,29 @@ test_run pdbg -b fake -P pib0/core0/thread0 probe > > > test_result 0 <<EOF > -fsi0: Fake FSI > +proc1: > + fsi1: Fake FSI > pib1: Fake PIB > core1: Fake Core > thread0: Fake Thread (*) > core3: Fake Core > thread0: Fake Thread (*) > +proc3: > + fsi3: Fake FSI > pib3: Fake PIB > core1: Fake Core > thread0: Fake Thread (*) > core3: Fake Core > thread0: Fake Thread (*) > +proc5: > + fsi5: Fake FSI > pib5: Fake PIB > core1: Fake Core > thread0: Fake Thread (*) > core3: Fake Core > thread0: Fake Thread (*) > +proc7: > + fsi7: Fake FSI > pib7: Fake PIB > core1: Fake Core > thread0: Fake Thread (*) > @@ -524,22 +637,29 @@ test_run pdbg -b fake -P pib[1,3,5,7,9]/core[1,3,5]/thread[0,2] probe > > > test_result 0 <<EOF > -fsi0: Fake FSI > +proc1: > + fsi1: Fake FSI > pib1: Fake PIB > core1: Fake Core > thread1: Fake Thread (*) > core3: Fake Core > thread1: Fake Thread (*) > +proc3: > + fsi3: Fake FSI > pib3: Fake PIB > core1: Fake Core > thread1: Fake Thread (*) > core3: Fake Core > thread1: Fake Thread (*) > +proc5: > + fsi5: Fake FSI > pib5: Fake PIB > core1: Fake Core > thread1: Fake Thread (*) > core3: Fake Core > thread1: Fake Thread (*) > +proc7: > + fsi7: Fake FSI > pib7: Fake PIB > core1: Fake Core > thread1: Fake Thread (*) > @@ -559,22 +679,46 @@ do_skip > test_run pdbg -b fake -P "fsi0/pib%d" probe > > > +test_result 1 <<EOF > +No valid targets found or specified. Try adding -p/-c/-t options to specify a target. > +Alternatively run 'pdbg -a probe' to get a list of all valid targets > +EOF > + > +do_skip > +test_run pdbg -b fake -P "fsi/pib" probe > + > + > test_result 0 <<EOF > -fsi0: Fake FSI > +proc0: > + fsi0: Fake FSI > pib0: Fake PIB > core3: Fake Core (*) > +proc1: > + fsi1: Fake FSI > pib1: Fake PIB > core3: Fake Core (*) > +proc2: > + fsi2: Fake FSI > pib2: Fake PIB > core3: Fake Core (*) > +proc3: > + fsi3: Fake FSI > pib3: Fake PIB > core3: Fake Core (*) > +proc4: > + fsi4: Fake FSI > pib4: Fake PIB > core3: Fake Core (*) > +proc5: > + fsi5: Fake FSI > pib5: Fake PIB > core3: Fake Core (*) > +proc6: > + fsi6: Fake FSI > pib6: Fake PIB > core3: Fake Core (*) > +proc7: > + fsi7: Fake FSI > pib7: Fake PIB > core3: Fake Core (*) > EOF >
diff --git a/fake.dts.m4 b/fake.dts.m4 index 92697df..a099154 100644 --- a/fake.dts.m4 +++ b/fake.dts.m4 @@ -1,3 +1,5 @@ +define(`CONCAT', `$1$2')dnl + dnl dnl forloop([var], [start], [end], [iterator]) dnl @@ -47,55 +49,67 @@ forloop(`i', `0', eval(`$3-1'), `dump_thread(i)') dump_core_post()') dnl -dnl dump_processor_pre([index], [addr]) +dnl dump_processor_pre([index]) dnl -define(`dump_processor_pre', -` - pib@$2 { +define(`dump_processor_pre',`dnl + pib { #address-cells = <0x1>; - #size-cells = <0x1>; - compatible = "ibm,fake-pib"; - reg = <0x$2 0x0>; - index = <0x$1>;') + #size-cells = <0x1>;') dnl dnl dump_processor_post() dnl -define(`dump_processor_post', ` }; +define(`dump_processor_post', ` }; ')dnl dnl -dnl dump_processor([index], [addr], [num_cores], [num_threads]) +dnl dump_processor([index], [num_cores], [num_threads]) dnl define(`dump_processor',dnl -`dump_processor_pre(`$1', `$2') -forloop(`i', `0', eval(`$3-1'), `dump_core(i, eval(10000+(i+1)*10), $4)') +`dump_processor_pre(`$1') +forloop(`i', `0', eval(`$2-1'), `dump_core(i, eval(10000+(i+1)*10), $3)') dump_processor_post()') dnl -dnl dump_fsi_pre([index], [addr]) +dnl dump_backend([index], [addr]) dnl -define(`dump_fsi_pre', -` +define(`dump_backend',dnl +`define(`pib_addr', eval(`$2+100'))dnl + fsi@$2 { #address-cells = <0x1>; #size-cells = <0x1>; compatible = "ibm,fake-fsi"; - reg = <0x$2 0x0>; - index = <0x$1>;') + system-path = "/proc$1/fsi"; + reg = <0x0 0x0>; + index = <0x$1>; + + CONCAT(pib@,pib_addr) { + #address-cells = <0x1>; + #size-cells = <0x1>; + compatible = "ibm,fake-pib"; + system-path = "/proc$1/pib"; + reg = <CONCAT(0x,pib_addr) 0x0>; + index = <0x$1>; + }; + }; + +')dnl -dnl -dnl dump_fsi_post() -dnl -define(`dump_fsi_post', ` };') dnl -dnl dump_fsi([index], [addr], [num_processors], [num_cores], [num_threads]) +dnl dump_system([num_processors], [num_cores], [num_threads]) dnl -define(`dump_fsi', -`dump_fsi_pre(`$1', `$2') -forloop(`i', `0', eval(`$3-1'), `dump_processor(i, eval(10000+i*1000), $4, $5)') -dump_fsi_post()') +define(`dump_system', +`forloop(`i', `0', eval(`$1-1'), `dump_backend(i, eval(20000+i*1000))') +forloop(`i', `0', eval(`$1-1'),dnl +` + CONCAT(proc,i) { + index = < CONCAT(0x,i) >; + +dump_processor(i, $2, $3) + }; +')') divert`'dnl /dts-v1/; @@ -103,5 +117,5 @@ divert`'dnl / { #address-cells = <0x1>; #size-cells = <0x1>; -dump_fsi(0, 0, 8, 4, 2) +dump_system(8, 4, 2) }; diff --git a/src/tests/libpdbg_probe_test.c b/src/tests/libpdbg_probe_test.c index 8b78b2e..ed8a800 100644 --- a/src/tests/libpdbg_probe_test.c +++ b/src/tests/libpdbg_probe_test.c @@ -129,6 +129,12 @@ static void test2(void) for_each_target(root, check_status, PDBG_TARGET_UNKNOWN); + pdbg_for_each_class_target("fsi", target) { + status = pdbg_target_probe(target); + assert(status == PDBG_TARGET_ENABLED); + + for_target_to_root(target, check_status, PDBG_TARGET_ENABLED); + } pdbg_for_each_class_target("pib", target) { status = pdbg_target_probe(target); assert(status == PDBG_TARGET_ENABLED); @@ -172,6 +178,13 @@ static void test2(void) check_status(target, PDBG_TARGET_RELEASED); } + pdbg_for_each_class_target("pib", target) { + pdbg_target_release(target); + } + pdbg_for_each_class_target("pib", target) { + for_each_target(target, check_status, PDBG_TARGET_RELEASED); + } + pdbg_for_each_class_target("fsi", target) { pdbg_target_release(target); } diff --git a/src/tests/libpdbg_target_test.c b/src/tests/libpdbg_target_test.c index 27efb56..9806281 100644 --- a/src/tests/libpdbg_target_test.c +++ b/src/tests/libpdbg_target_test.c @@ -72,7 +72,7 @@ int main(void) assert(root); count = count_class_target("fsi"); - assert(count == 1); + assert(count == 8); count = count_class_target("pib"); assert(count == 8); @@ -83,7 +83,28 @@ int main(void) count = count_class_target("thread"); assert(count == 64); + pdbg_for_each_child_target(root, parent) { + name = pdbg_target_dn_name(parent); + assert(strncmp(name, "proc", 4) == 0); + + pdbg_for_each_target("pib", parent, target) { + name = pdbg_target_class_name(target); + assert(!strcmp(name, "pib")); + } + + pdbg_for_each_target("fsi", parent, target) { + name = pdbg_target_class_name(target); + assert(!strcmp(name, "fsi")); + } + }; + pdbg_for_each_class_target("fsi", target) { + parent = pdbg_target_parent(NULL, target); + assert(parent); + + name = pdbg_target_dn_name(parent); + assert(strncmp(name, "proc", 4) == 0); + parent = pdbg_target_parent("fsi", target); assert(parent == NULL); @@ -97,19 +118,19 @@ int main(void) assert(parent == NULL); count = count_child_target(target); - assert(count == 8); + assert(count == 0); count = count_target(target, "fsi"); assert(count == 1); count = count_target(target, "pib"); - assert(count == 8); + assert(count == 0); count = count_target(target, "core"); - assert(count == 32); + assert(count == 0); count = count_target(target, "thread"); - assert(count == 64); + assert(count == 0); name = pdbg_target_name(target); assert(!strcmp(name, "Fake FSI")); @@ -122,11 +143,14 @@ int main(void) } pdbg_for_each_class_target("pib", target) { - parent = pdbg_target_parent("fsi", target); + parent = pdbg_target_parent(NULL, target); assert(parent); - parent2 = pdbg_target_require_parent("fsi", target); - assert(parent == parent2); + name = pdbg_target_dn_name(parent); + assert(strncmp(name, "proc", 4) == 0); + + parent = pdbg_target_parent("fsi", target); + assert(parent == NULL); parent = pdbg_target_parent("pib", target); assert(parent == NULL); @@ -167,10 +191,7 @@ int main(void) uint32_t index; parent = pdbg_target_parent("fsi", target); - assert(parent); - - parent2 = pdbg_target_require_parent("fsi", target); - assert(parent == parent2); + assert(parent == NULL); parent = pdbg_target_parent("pib", target); assert(parent); @@ -216,10 +237,7 @@ int main(void) pdbg_for_each_class_target("thread", target) { parent = pdbg_target_parent("fsi", target); - assert(parent); - - parent2 = pdbg_target_require_parent("fsi", target); - assert(parent == parent2); + assert(parent == NULL); parent = pdbg_target_parent("pib", target); assert(parent); diff --git a/tests/test_selection.sh b/tests/test_selection.sh index 50db9e4..0931051 100755 --- a/tests/test_selection.sh +++ b/tests/test_selection.sh @@ -23,7 +23,8 @@ test_run pdbg -b fake probe test_result 0 <<EOF -fsi0: Fake FSI (*) +proc0: + fsi0: Fake FSI (*) pib0: Fake PIB (*) core0: Fake Core (*) thread0: Fake Thread (*) @@ -37,6 +38,8 @@ fsi0: Fake FSI (*) core3: Fake Core (*) thread0: Fake Thread (*) thread1: Fake Thread (*) +proc1: + fsi1: Fake FSI (*) pib1: Fake PIB (*) core0: Fake Core (*) thread0: Fake Thread (*) @@ -50,6 +53,8 @@ fsi0: Fake FSI (*) core3: Fake Core (*) thread0: Fake Thread (*) thread1: Fake Thread (*) +proc2: + fsi2: Fake FSI (*) pib2: Fake PIB (*) core0: Fake Core (*) thread0: Fake Thread (*) @@ -63,6 +68,8 @@ fsi0: Fake FSI (*) core3: Fake Core (*) thread0: Fake Thread (*) thread1: Fake Thread (*) +proc3: + fsi3: Fake FSI (*) pib3: Fake PIB (*) core0: Fake Core (*) thread0: Fake Thread (*) @@ -76,6 +83,8 @@ fsi0: Fake FSI (*) core3: Fake Core (*) thread0: Fake Thread (*) thread1: Fake Thread (*) +proc4: + fsi4: Fake FSI (*) pib4: Fake PIB (*) core0: Fake Core (*) thread0: Fake Thread (*) @@ -89,6 +98,8 @@ fsi0: Fake FSI (*) core3: Fake Core (*) thread0: Fake Thread (*) thread1: Fake Thread (*) +proc5: + fsi5: Fake FSI (*) pib5: Fake PIB (*) core0: Fake Core (*) thread0: Fake Thread (*) @@ -102,6 +113,8 @@ fsi0: Fake FSI (*) core3: Fake Core (*) thread0: Fake Thread (*) thread1: Fake Thread (*) +proc6: + fsi6: Fake FSI (*) pib6: Fake PIB (*) core0: Fake Core (*) thread0: Fake Thread (*) @@ -115,6 +128,8 @@ fsi0: Fake FSI (*) core3: Fake Core (*) thread0: Fake Thread (*) thread1: Fake Thread (*) +proc7: + fsi7: Fake FSI (*) pib7: Fake PIB (*) core0: Fake Core (*) thread0: Fake Thread (*) @@ -135,7 +150,8 @@ test_run pdbg -b fake -a probe test_result 0 <<EOF -fsi0: Fake FSI (*) +proc0: + fsi0: Fake FSI (*) pib0: Fake PIB (*) core0: Fake Core (*) thread0: Fake Thread (*) @@ -156,35 +172,50 @@ test_run pdbg -b fake -p0 -a probe test_result 0 <<EOF -fsi0: Fake FSI (*) +proc0: + fsi0: Fake FSI (*) pib0: Fake PIB (*) core0: Fake Core (*) thread0: Fake Thread (*) thread1: Fake Thread (*) +proc1: + fsi1: Fake FSI (*) pib1: Fake PIB (*) core0: Fake Core (*) thread0: Fake Thread (*) thread1: Fake Thread (*) +proc2: + fsi2: Fake FSI (*) pib2: Fake PIB (*) core0: Fake Core (*) thread0: Fake Thread (*) thread1: Fake Thread (*) +proc3: + fsi3: Fake FSI (*) pib3: Fake PIB (*) core0: Fake Core (*) thread0: Fake Thread (*) thread1: Fake Thread (*) +proc4: + fsi4: Fake FSI (*) pib4: Fake PIB (*) core0: Fake Core (*) thread0: Fake Thread (*) thread1: Fake Thread (*) +proc5: + fsi5: Fake FSI (*) pib5: Fake PIB (*) core0: Fake Core (*) thread0: Fake Thread (*) thread1: Fake Thread (*) +proc6: + fsi6: Fake FSI (*) pib6: Fake PIB (*) core0: Fake Core (*) thread0: Fake Thread (*) thread1: Fake Thread (*) +proc7: + fsi7: Fake FSI (*) pib7: Fake PIB (*) core0: Fake Core (*) thread0: Fake Thread (*) @@ -196,7 +227,8 @@ test_run pdbg -b fake -c0 -a probe test_result 0 <<EOF -fsi0: Fake FSI (*) +proc0: + fsi0: Fake FSI (*) pib0: Fake PIB (*) core0: Fake Core (*) thread0: Fake Thread (*) @@ -206,6 +238,8 @@ fsi0: Fake FSI (*) thread0: Fake Thread (*) core3: Fake Core (*) thread0: Fake Thread (*) +proc1: + fsi1: Fake FSI (*) pib1: Fake PIB (*) core0: Fake Core (*) thread0: Fake Thread (*) @@ -215,6 +249,8 @@ fsi0: Fake FSI (*) thread0: Fake Thread (*) core3: Fake Core (*) thread0: Fake Thread (*) +proc2: + fsi2: Fake FSI (*) pib2: Fake PIB (*) core0: Fake Core (*) thread0: Fake Thread (*) @@ -224,6 +260,8 @@ fsi0: Fake FSI (*) thread0: Fake Thread (*) core3: Fake Core (*) thread0: Fake Thread (*) +proc3: + fsi3: Fake FSI (*) pib3: Fake PIB (*) core0: Fake Core (*) thread0: Fake Thread (*) @@ -233,6 +271,8 @@ fsi0: Fake FSI (*) thread0: Fake Thread (*) core3: Fake Core (*) thread0: Fake Thread (*) +proc4: + fsi4: Fake FSI (*) pib4: Fake PIB (*) core0: Fake Core (*) thread0: Fake Thread (*) @@ -242,6 +282,8 @@ fsi0: Fake FSI (*) thread0: Fake Thread (*) core3: Fake Core (*) thread0: Fake Thread (*) +proc5: + fsi5: Fake FSI (*) pib5: Fake PIB (*) core0: Fake Core (*) thread0: Fake Thread (*) @@ -251,6 +293,8 @@ fsi0: Fake FSI (*) thread0: Fake Thread (*) core3: Fake Core (*) thread0: Fake Thread (*) +proc6: + fsi6: Fake FSI (*) pib6: Fake PIB (*) core0: Fake Core (*) thread0: Fake Thread (*) @@ -260,6 +304,8 @@ fsi0: Fake FSI (*) thread0: Fake Thread (*) core3: Fake Core (*) thread0: Fake Thread (*) +proc7: + fsi7: Fake FSI (*) pib7: Fake PIB (*) core0: Fake Core (*) thread0: Fake Thread (*) @@ -276,7 +322,8 @@ test_run pdbg -b fake -t0 -a probe test_result 0 <<EOF -fsi0: Fake FSI (*) +proc0: + fsi0: Fake FSI (*) pib0: Fake PIB (*) core2: Fake Core (*) thread0: Fake Thread (*) @@ -288,7 +335,8 @@ test_run pdbg -b fake -p0 -c2 -a probe test_result 0 <<EOF -fsi0: Fake FSI (*) +proc0: + fsi0: Fake FSI (*) pib0: Fake PIB (*) core2: Fake Core (*) thread1: Fake Thread (*) @@ -299,19 +347,28 @@ test_run pdbg -b fake -p0 -c2 -t1 -a probe test_result 0 <<EOF -fsi0: Fake FSI +proc1: + fsi1: Fake FSI (*) pib1: Fake PIB (*) core0: Fake Core (*) thread0: Fake Thread (*) +proc2: + fsi2: Fake FSI (*) pib2: Fake PIB (*) core0: Fake Core (*) thread0: Fake Thread (*) +proc3: + fsi3: Fake FSI (*) pib3: Fake PIB (*) core0: Fake Core (*) thread0: Fake Thread (*) +proc5: + fsi5: Fake FSI (*) pib5: Fake PIB (*) core0: Fake Core (*) thread0: Fake Thread (*) +proc6: + fsi6: Fake FSI (*) pib6: Fake PIB (*) core0: Fake Core (*) thread0: Fake Thread (*) @@ -322,7 +379,8 @@ test_run pdbg -b fake -p1-3,5,5-6 -c0 -t0 probe test_result 0 <<EOF -fsi0: Fake FSI (*) +proc0: + fsi0: Fake FSI (*) pib0: Fake PIB (*) EOF @@ -371,7 +429,8 @@ test_run pdbg -b fake -t0 -p0 probe test_result 0 <<EOF -fsi0: Fake FSI (*) +proc0: + fsi0: Fake FSI (*) pib0: Fake PIB (*) core0: Fake Core (*) EOF @@ -381,7 +440,8 @@ test_run pdbg -b fake -c0 -p0 probe test_result 0 <<EOF -fsi0: Fake FSI (*) +proc0: + fsi0: Fake FSI (*) pib0: Fake PIB (*) core0: Fake Core (*) thread0: Fake Thread (*) @@ -392,22 +452,29 @@ test_run pdbg -b fake -t0 -c0 -p0 probe test_result 0 <<EOF -fsi0: Fake FSI +proc1: + fsi1: Fake FSI (*) pib1: Fake PIB (*) core1: Fake Core (*) thread0: Fake Thread (*) core3: Fake Core (*) thread0: Fake Thread (*) +proc3: + fsi3: Fake FSI (*) pib3: Fake PIB (*) core1: Fake Core (*) thread0: Fake Thread (*) core3: Fake Core (*) thread0: Fake Thread (*) +proc5: + fsi5: Fake FSI (*) pib5: Fake PIB (*) core1: Fake Core (*) thread0: Fake Thread (*) core3: Fake Core (*) thread0: Fake Thread (*) +proc7: + fsi7: Fake FSI (*) pib7: Fake PIB (*) core1: Fake Core (*) thread0: Fake Thread (*) @@ -420,22 +487,29 @@ test_run pdbg -b fake -p1,3,5,7,9 -c1,3,5 -t0,2 probe test_result 0 <<EOF -fsi0: Fake FSI +proc1: + fsi1: Fake FSI (*) pib1: Fake PIB (*) core1: Fake Core (*) thread1: Fake Thread (*) core3: Fake Core (*) thread1: Fake Thread (*) +proc3: + fsi3: Fake FSI (*) pib3: Fake PIB (*) core1: Fake Core (*) thread1: Fake Thread (*) core3: Fake Core (*) thread1: Fake Thread (*) +proc5: + fsi5: Fake FSI (*) pib5: Fake PIB (*) core1: Fake Core (*) thread1: Fake Thread (*) core3: Fake Core (*) thread1: Fake Thread (*) +proc7: + fsi7: Fake FSI (*) pib7: Fake PIB (*) core1: Fake Core (*) thread1: Fake Thread (*) diff --git a/tests/test_selection2.sh b/tests/test_selection2.sh index 6c0a50e..add51c0 100755 --- a/tests/test_selection2.sh +++ b/tests/test_selection2.sh @@ -14,7 +14,8 @@ do_skip () } test_result 0 <<EOF -fsi0: Fake FSI +proc0: + fsi0: Fake FSI pib0: Fake PIB core0: Fake Core thread0: Fake Thread (*) @@ -28,6 +29,8 @@ fsi0: Fake FSI core3: Fake Core thread0: Fake Thread (*) thread1: Fake Thread (*) +proc1: + fsi1: Fake FSI pib1: Fake PIB core0: Fake Core thread0: Fake Thread (*) @@ -41,6 +44,8 @@ fsi0: Fake FSI core3: Fake Core thread0: Fake Thread (*) thread1: Fake Thread (*) +proc2: + fsi2: Fake FSI pib2: Fake PIB core0: Fake Core thread0: Fake Thread (*) @@ -54,6 +59,8 @@ fsi0: Fake FSI core3: Fake Core thread0: Fake Thread (*) thread1: Fake Thread (*) +proc3: + fsi3: Fake FSI pib3: Fake PIB core0: Fake Core thread0: Fake Thread (*) @@ -67,6 +74,8 @@ fsi0: Fake FSI core3: Fake Core thread0: Fake Thread (*) thread1: Fake Thread (*) +proc4: + fsi4: Fake FSI pib4: Fake PIB core0: Fake Core thread0: Fake Thread (*) @@ -80,6 +89,8 @@ fsi0: Fake FSI core3: Fake Core thread0: Fake Thread (*) thread1: Fake Thread (*) +proc5: + fsi5: Fake FSI pib5: Fake PIB core0: Fake Core thread0: Fake Thread (*) @@ -93,6 +104,8 @@ fsi0: Fake FSI core3: Fake Core thread0: Fake Thread (*) thread1: Fake Thread (*) +proc6: + fsi6: Fake FSI pib6: Fake PIB core0: Fake Core thread0: Fake Thread (*) @@ -106,6 +119,8 @@ fsi0: Fake FSI core3: Fake Core thread0: Fake Thread (*) thread1: Fake Thread (*) +proc7: + fsi7: Fake FSI pib7: Fake PIB core0: Fake Core thread0: Fake Thread (*) @@ -126,7 +141,8 @@ test_run pdbg -b fake -P thread probe test_result 0 <<EOF -fsi0: Fake FSI +proc0: + fsi0: Fake FSI pib0: Fake PIB core0: Fake Core thread0: Fake Thread (*) @@ -147,35 +163,50 @@ test_run pdbg -b fake -P pib0/thread probe test_result 0 <<EOF -fsi0: Fake FSI +proc0: + fsi0: Fake FSI pib0: Fake PIB core0: Fake Core thread0: Fake Thread (*) thread1: Fake Thread (*) +proc1: + fsi1: Fake FSI pib1: Fake PIB core0: Fake Core thread0: Fake Thread (*) thread1: Fake Thread (*) +proc2: + fsi2: Fake FSI pib2: Fake PIB core0: Fake Core thread0: Fake Thread (*) thread1: Fake Thread (*) +proc3: + fsi3: Fake FSI pib3: Fake PIB core0: Fake Core thread0: Fake Thread (*) thread1: Fake Thread (*) +proc4: + fsi4: Fake FSI pib4: Fake PIB core0: Fake Core thread0: Fake Thread (*) thread1: Fake Thread (*) +proc5: + fsi5: Fake FSI pib5: Fake PIB core0: Fake Core thread0: Fake Thread (*) thread1: Fake Thread (*) +proc6: + fsi6: Fake FSI pib6: Fake PIB core0: Fake Core thread0: Fake Thread (*) thread1: Fake Thread (*) +proc7: + fsi7: Fake FSI pib7: Fake PIB core0: Fake Core thread0: Fake Thread (*) @@ -187,7 +218,8 @@ test_run pdbg -b fake -P core0/thread probe test_result 0 <<EOF -fsi0: Fake FSI +proc0: + fsi0: Fake FSI pib0: Fake PIB core0: Fake Core thread0: Fake Thread (*) @@ -197,6 +229,8 @@ fsi0: Fake FSI thread0: Fake Thread (*) core3: Fake Core thread0: Fake Thread (*) +proc1: + fsi1: Fake FSI pib1: Fake PIB core0: Fake Core thread0: Fake Thread (*) @@ -206,6 +240,8 @@ fsi0: Fake FSI thread0: Fake Thread (*) core3: Fake Core thread0: Fake Thread (*) +proc2: + fsi2: Fake FSI pib2: Fake PIB core0: Fake Core thread0: Fake Thread (*) @@ -215,6 +251,8 @@ fsi0: Fake FSI thread0: Fake Thread (*) core3: Fake Core thread0: Fake Thread (*) +proc3: + fsi3: Fake FSI pib3: Fake PIB core0: Fake Core thread0: Fake Thread (*) @@ -224,6 +262,8 @@ fsi0: Fake FSI thread0: Fake Thread (*) core3: Fake Core thread0: Fake Thread (*) +proc4: + fsi4: Fake FSI pib4: Fake PIB core0: Fake Core thread0: Fake Thread (*) @@ -233,6 +273,8 @@ fsi0: Fake FSI thread0: Fake Thread (*) core3: Fake Core thread0: Fake Thread (*) +proc5: + fsi5: Fake FSI pib5: Fake PIB core0: Fake Core thread0: Fake Thread (*) @@ -242,6 +284,8 @@ fsi0: Fake FSI thread0: Fake Thread (*) core3: Fake Core thread0: Fake Thread (*) +proc6: + fsi6: Fake FSI pib6: Fake PIB core0: Fake Core thread0: Fake Thread (*) @@ -251,6 +295,8 @@ fsi0: Fake FSI thread0: Fake Thread (*) core3: Fake Core thread0: Fake Thread (*) +proc7: + fsi7: Fake FSI pib7: Fake PIB core0: Fake Core thread0: Fake Thread (*) @@ -267,7 +313,8 @@ test_run pdbg -b fake -P thread0 probe test_result 0 <<EOF -fsi0: Fake FSI +proc0: + fsi0: Fake FSI pib0: Fake PIB core2: Fake Core thread0: Fake Thread (*) @@ -279,7 +326,8 @@ test_run pdbg -b fake -P pib0/core2/thread probe test_result 0 <<EOF -fsi0: Fake FSI +proc0: + fsi0: Fake FSI pib0: Fake PIB core2: Fake Core thread1: Fake Thread (*) @@ -290,19 +338,28 @@ test_run pdbg -b fake -P pib0/core2/thread1 probe test_result 0 <<EOF -fsi0: Fake FSI +proc1: + fsi1: Fake FSI pib1: Fake PIB core0: Fake Core thread0: Fake Thread (*) +proc2: + fsi2: Fake FSI pib2: Fake PIB core0: Fake Core thread0: Fake Thread (*) +proc3: + fsi3: Fake FSI pib3: Fake PIB core0: Fake Core thread0: Fake Thread (*) +proc5: + fsi5: Fake FSI pib5: Fake PIB core0: Fake Core thread0: Fake Thread (*) +proc6: + fsi6: Fake FSI pib6: Fake PIB core0: Fake Core thread0: Fake Thread (*) @@ -313,7 +370,8 @@ test_run pdbg -b fake -P pib[1-3,5,5-6]/core0/thread0 probe test_result 0 <<EOF -fsi0: Fake FSI +proc0: + fsi0: Fake FSI pib0: Fake PIB (*) EOF @@ -322,21 +380,36 @@ test_run pdbg -b fake -P pib0 probe test_result 0 <<EOF -fsi0: Fake FSI +proc0: + fsi0: Fake FSI pib0: Fake PIB core0: Fake Core (*) +proc1: + fsi1: Fake FSI pib1: Fake PIB core0: Fake Core (*) +proc2: + fsi2: Fake FSI pib2: Fake PIB core0: Fake Core (*) +proc3: + fsi3: Fake FSI pib3: Fake PIB core0: Fake Core (*) +proc4: + fsi4: Fake FSI pib4: Fake PIB core0: Fake Core (*) +proc5: + fsi5: Fake FSI pib5: Fake PIB core0: Fake Core (*) +proc6: + fsi6: Fake FSI pib6: Fake PIB core0: Fake Core (*) +proc7: + fsi7: Fake FSI pib7: Fake PIB core0: Fake Core (*) EOF @@ -346,7 +419,8 @@ test_run pdbg -b fake -P core0 probe test_result 0 <<EOF -fsi0: Fake FSI +proc0: + fsi0: Fake FSI pib0: Fake PIB core0: Fake Core thread0: Fake Thread (*) @@ -356,6 +430,8 @@ fsi0: Fake FSI thread0: Fake Thread (*) core3: Fake Core thread0: Fake Thread (*) +proc1: + fsi1: Fake FSI pib1: Fake PIB core0: Fake Core thread0: Fake Thread (*) @@ -365,6 +441,8 @@ fsi0: Fake FSI thread0: Fake Thread (*) core3: Fake Core thread0: Fake Thread (*) +proc2: + fsi2: Fake FSI pib2: Fake PIB core0: Fake Core thread0: Fake Thread (*) @@ -374,6 +452,8 @@ fsi0: Fake FSI thread0: Fake Thread (*) core3: Fake Core thread0: Fake Thread (*) +proc3: + fsi3: Fake FSI pib3: Fake PIB core0: Fake Core thread0: Fake Thread (*) @@ -383,6 +463,8 @@ fsi0: Fake FSI thread0: Fake Thread (*) core3: Fake Core thread0: Fake Thread (*) +proc4: + fsi4: Fake FSI pib4: Fake PIB core0: Fake Core thread0: Fake Thread (*) @@ -392,6 +474,8 @@ fsi0: Fake FSI thread0: Fake Thread (*) core3: Fake Core thread0: Fake Thread (*) +proc5: + fsi5: Fake FSI pib5: Fake PIB core0: Fake Core thread0: Fake Thread (*) @@ -401,6 +485,8 @@ fsi0: Fake FSI thread0: Fake Thread (*) core3: Fake Core thread0: Fake Thread (*) +proc6: + fsi6: Fake FSI pib6: Fake PIB core0: Fake Core thread0: Fake Thread (*) @@ -410,6 +496,8 @@ fsi0: Fake FSI thread0: Fake Thread (*) core3: Fake Core thread0: Fake Thread (*) +proc7: + fsi7: Fake FSI pib7: Fake PIB core0: Fake Core thread0: Fake Thread (*) @@ -426,28 +514,43 @@ test_run pdbg -b fake -P thread0 probe test_result 0 <<EOF -fsi0: Fake FSI +proc0: + fsi0: Fake FSI pib0: Fake PIB core0: Fake Core thread0: Fake Thread (*) +proc1: + fsi1: Fake FSI pib1: Fake PIB core0: Fake Core thread0: Fake Thread (*) +proc2: + fsi2: Fake FSI pib2: Fake PIB core0: Fake Core thread0: Fake Thread (*) +proc3: + fsi3: Fake FSI pib3: Fake PIB core0: Fake Core thread0: Fake Thread (*) +proc4: + fsi4: Fake FSI pib4: Fake PIB core0: Fake Core thread0: Fake Thread (*) +proc5: + fsi5: Fake FSI pib5: Fake PIB core0: Fake Core thread0: Fake Thread (*) +proc6: + fsi6: Fake FSI pib6: Fake PIB core0: Fake Core thread0: Fake Thread (*) +proc7: + fsi7: Fake FSI pib7: Fake PIB core0: Fake Core thread0: Fake Thread (*) @@ -458,7 +561,8 @@ test_run pdbg -b fake -P core0/thread0 probe test_result 0 <<EOF -fsi0: Fake FSI +proc0: + fsi0: Fake FSI pib0: Fake PIB core0: Fake Core thread0: Fake Thread (*) @@ -475,7 +579,8 @@ test_run pdbg -b fake -P pib0/thread0 probe test_result 0 <<EOF -fsi0: Fake FSI +proc0: + fsi0: Fake FSI pib0: Fake PIB core0: Fake Core (*) EOF @@ -485,7 +590,8 @@ test_run pdbg -b fake -P pib0/core0 probe test_result 0 <<EOF -fsi0: Fake FSI +proc0: + fsi0: Fake FSI pib0: Fake PIB core0: Fake Core thread0: Fake Thread (*) @@ -496,22 +602,29 @@ test_run pdbg -b fake -P pib0/core0/thread0 probe test_result 0 <<EOF -fsi0: Fake FSI +proc1: + fsi1: Fake FSI pib1: Fake PIB core1: Fake Core thread0: Fake Thread (*) core3: Fake Core thread0: Fake Thread (*) +proc3: + fsi3: Fake FSI pib3: Fake PIB core1: Fake Core thread0: Fake Thread (*) core3: Fake Core thread0: Fake Thread (*) +proc5: + fsi5: Fake FSI pib5: Fake PIB core1: Fake Core thread0: Fake Thread (*) core3: Fake Core thread0: Fake Thread (*) +proc7: + fsi7: Fake FSI pib7: Fake PIB core1: Fake Core thread0: Fake Thread (*) @@ -524,22 +637,29 @@ test_run pdbg -b fake -P pib[1,3,5,7,9]/core[1,3,5]/thread[0,2] probe test_result 0 <<EOF -fsi0: Fake FSI +proc1: + fsi1: Fake FSI pib1: Fake PIB core1: Fake Core thread1: Fake Thread (*) core3: Fake Core thread1: Fake Thread (*) +proc3: + fsi3: Fake FSI pib3: Fake PIB core1: Fake Core thread1: Fake Thread (*) core3: Fake Core thread1: Fake Thread (*) +proc5: + fsi5: Fake FSI pib5: Fake PIB core1: Fake Core thread1: Fake Thread (*) core3: Fake Core thread1: Fake Thread (*) +proc7: + fsi7: Fake FSI pib7: Fake PIB core1: Fake Core thread1: Fake Thread (*) @@ -559,22 +679,46 @@ do_skip test_run pdbg -b fake -P "fsi0/pib%d" probe +test_result 1 <<EOF +No valid targets found or specified. Try adding -p/-c/-t options to specify a target. +Alternatively run 'pdbg -a probe' to get a list of all valid targets +EOF + +do_skip +test_run pdbg -b fake -P "fsi/pib" probe + + test_result 0 <<EOF -fsi0: Fake FSI +proc0: + fsi0: Fake FSI pib0: Fake PIB core3: Fake Core (*) +proc1: + fsi1: Fake FSI pib1: Fake PIB core3: Fake Core (*) +proc2: + fsi2: Fake FSI pib2: Fake PIB core3: Fake Core (*) +proc3: + fsi3: Fake FSI pib3: Fake PIB core3: Fake Core (*) +proc4: + fsi4: Fake FSI pib4: Fake PIB core3: Fake Core (*) +proc5: + fsi5: Fake FSI pib5: Fake PIB core3: Fake Core (*) +proc6: + fsi6: Fake FSI pib6: Fake PIB core3: Fake Core (*) +proc7: + fsi7: Fake FSI pib7: Fake PIB core3: Fake Core (*) EOF
Signed-off-by: Amitay Isaacs <amitay@ozlabs.org> --- fake.dts.m4 | 68 +++++++----- src/tests/libpdbg_probe_test.c | 13 +++ src/tests/libpdbg_target_test.c | 50 ++++++--- tests/test_selection.sh | 98 +++++++++++++++--- tests/test_selection2.sh | 178 +++++++++++++++++++++++++++++--- 5 files changed, 335 insertions(+), 72 deletions(-)