From patchwork Thu Mar 14 06:44:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amitay Isaacs X-Patchwork-Id: 1056378 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44KfN93zx8z9s70 for ; Thu, 14 Mar 2019 17:45:13 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="Nn75vblz"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 44KfN86C0MzDqMm for ; Thu, 14 Mar 2019 17:45:12 +1100 (AEDT) X-Original-To: pdbg@lists.ozlabs.org Delivered-To: pdbg@lists.ozlabs.org Received: from ozlabs.org (bilbo.ozlabs.org [IPv6:2401:3900:2:1::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 44KfMp2qFYzDqLD for ; Thu, 14 Mar 2019 17:44:54 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=ozlabs.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="Nn75vblz"; dkim-atps=neutral Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 44KfMn5fRHz9s4V; Thu, 14 Mar 2019 17:44:53 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ozlabs.org; s=201707; t=1552545893; bh=40XbLCUj6ve1iNMRo+lu8Tl51952N359yp3kkLVThEc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Nn75vblz3GZAvW618Atniv8+3kWro4MN15kCCHlTyEgbGRueHKPU2r6Kzh397rGwW RJ286s+S19VoOc+mKkemfbiRliVRaT9WM7bAyopB48jzWTqWKEJ7X6a1qTG940W4Pu IpYDE1YVEPkrr6czIwrNi2x2NTiVumkiU/GTipxldNFJW0htuAGS3s9bbfMVZn13se Ofm5hFghBSAQzjLEUaOMX62tqXYXk1qgIRzBqg3edbyjHXplm4O+IGS6x//NQSkRvC edRr0Hl0PnN9vsFI5936YzHI4jNycjPQhXuurfelioLFViAirdqUQkgs5dNi4Dglnq atl0oCwMEdQxw== From: Amitay Isaacs To: pdbg@lists.ozlabs.org Date: Thu, 14 Mar 2019 17:44:47 +1100 Message-Id: <20190314064449.1623715-2-amitay@ozlabs.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190314064449.1623715-1-amitay@ozlabs.org> References: <20190314064449.1623715-1-amitay@ozlabs.org> MIME-Version: 1.0 Subject: [Pdbg] [PATCH 1/3] path: Match targets with dn name correctly X-BeenThere: pdbg@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "mailing list for https://github.com/open-power/pdbg development" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Amitay Isaacs Errors-To: pdbg-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Pdbg" Signed-off-by: Amitay Isaacs --- src/path.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/path.c b/src/path.c index 0141085..a745838 100644 --- a/src/path.c +++ b/src/path.c @@ -241,12 +241,14 @@ static void path_pattern_match(struct pdbg_target *target, if (!classname) goto end; - safe_strcpy(comp_name, sizeof(comp_name), classname); if (pats[level].match_full) { - tok = comp_name; + const char *dn_name = pdbg_target_dn_name(target); + + safe_strcpy(comp_name, sizeof(comp_name), dn_name); } else { - tok = strtok(comp_name, "@"); + safe_strcpy(comp_name, sizeof(comp_name), classname); } + tok = comp_name; if (!strcmp(tok, pats[level].prefix)) { found = true; From patchwork Thu Mar 14 06:44:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amitay Isaacs X-Patchwork-Id: 1056375 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44KfMz5C32z9s4V for ; Thu, 14 Mar 2019 17:45:03 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="IZrd8fcV"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 44KfMz0w97zDqMT for ; Thu, 14 Mar 2019 17:45:03 +1100 (AEDT) X-Original-To: pdbg@lists.ozlabs.org Delivered-To: pdbg@lists.ozlabs.org Received: from ozlabs.org (bilbo.ozlabs.org [IPv6:2401:3900:2:1::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 44KfMp6PvbzDqLF for ; Thu, 14 Mar 2019 17:44:54 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=ozlabs.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="IZrd8fcV"; dkim-atps=neutral Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 44KfMp2LwJz9s70; Thu, 14 Mar 2019 17:44:54 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ozlabs.org; s=201707; t=1552545894; bh=OeWKcj6huXEG3iUKYAxjmcR4lPmr7B/qXEHFMTImJ94=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IZrd8fcV3ipUy0PNgQnTI3VYrD+Q1YtR5DlnNWD/A6GVJ5hLneRglHkYj2rVKe59v JZTacl4obKU+/PoLPfmyAL+BaJ5vizC4dzV3FoCMAmAoppFBoPvDbTm49onCwSggJE TpZOLkcZRzRQm62rlJsUFlgP3awwHFDJVmhiJghRgh+Ha6xAw90o2xPktXZ8OyVrFa aYjtkQA2zzCqxM4eVjaC02V4DpPEYVg/Lj/BcO8lb5o6PPjg54jnhTC+MsEG7CRKDQ D3VnXo386SVWL5NXC5wZKz6YKDIR/Vfj/rcFqla+0LMQO0HULoF4fkMdW6bIU96/NG xGPa61oa49jfg== From: Amitay Isaacs To: pdbg@lists.ozlabs.org Date: Thu, 14 Mar 2019 17:44:48 +1100 Message-Id: <20190314064449.1623715-3-amitay@ozlabs.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190314064449.1623715-1-amitay@ozlabs.org> References: <20190314064449.1623715-1-amitay@ozlabs.org> MIME-Version: 1.0 Subject: [Pdbg] [PATCH 2/3] tests: Add a test for dn name match X-BeenThere: pdbg@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "mailing list for https://github.com/open-power/pdbg development" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Amitay Isaacs Errors-To: pdbg-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Pdbg" Signed-off-by: Amitay Isaacs --- fake.dts.m4 | 2 +- tests/test_selection2.sh | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/fake.dts.m4 b/fake.dts.m4 index 4c6c145..92697df 100644 --- a/fake.dts.m4 +++ b/fake.dts.m4 @@ -69,7 +69,7 @@ dnl dump_processor([index], [addr], [num_cores], [num_threads]) dnl define(`dump_processor',dnl `dump_processor_pre(`$1', `$2') -forloop(`i', `0', eval(`$3-1'), `dump_core(i, eval($2+(i+1)*10), $4)') +forloop(`i', `0', eval(`$3-1'), `dump_core(i, eval(10000+(i+1)*10), $4)') dump_processor_post()') dnl diff --git a/tests/test_selection2.sh b/tests/test_selection2.sh index a811445..6c0a50e 100755 --- a/tests/test_selection2.sh +++ b/tests/test_selection2.sh @@ -557,3 +557,27 @@ EOF do_skip test_run pdbg -b fake -P "fsi0/pib%d" probe + + +test_result 0 < X-Patchwork-Id: 1056377 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44KfN65R0hz9s4V for ; Thu, 14 Mar 2019 17:45:10 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="sd9OQOiv"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 44KfN63W1LzDqLF for ; Thu, 14 Mar 2019 17:45:10 +1100 (AEDT) X-Original-To: pdbg@lists.ozlabs.org Delivered-To: pdbg@lists.ozlabs.org Received: from ozlabs.org (bilbo.ozlabs.org [203.11.71.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 44KfMq2LhBzDqLH for ; Thu, 14 Mar 2019 17:44:55 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=ozlabs.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="sd9OQOiv"; dkim-atps=neutral Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 44KfMp5yf8z9s71; Thu, 14 Mar 2019 17:44:54 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ozlabs.org; s=201707; t=1552545894; bh=3BKeTqc5MyJYgudefTSZWeql3r94t5h9pf0syJNKm2o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sd9OQOivZAJ2PZnM98YTA11XJfzRpncWm/LkUMI5LdPhp36tGJkaTJihZnhOhJf+5 XP8bm5sq6ErFgaWgD3eA1vClLt0s9eJBgifjpDYTXLXHvzpSWIhXVJnFhxfd/Fw88o nxwGxDqWvXtiPA/0+MFJjTrURq3o6Tldn7ds3zYe4QuN3ha7G25IenVOUpIObSASbC hpWMUi6lGVIp8Dh7XwN7NbyWlAd1XlaLmmGOVTDOvmSQONL6LS4/wg4gcC8BhJBbaC bzawkyAwk0U80WWbaTQeDrPoIgPNGeebtjDHng0irGTqBPgfNohq8Vr/jQfnGlJBhw fO4KNhfqj3Esg== From: Amitay Isaacs To: pdbg@lists.ozlabs.org Date: Thu, 14 Mar 2019 17:44:49 +1100 Message-Id: <20190314064449.1623715-4-amitay@ozlabs.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190314064449.1623715-1-amitay@ozlabs.org> References: <20190314064449.1623715-1-amitay@ozlabs.org> MIME-Version: 1.0 Subject: [Pdbg] [PATCH 3/3] path: Avoid a match for nested nodes of the same class X-BeenThere: pdbg@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "mailing list for https://github.com/open-power/pdbg development" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Amitay Isaacs Errors-To: pdbg-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Pdbg" Signed-off-by: Amitay Isaacs --- src/path.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/path.c b/src/path.c index a745838..e6c9d94 100644 --- a/src/path.c +++ b/src/path.c @@ -270,6 +270,19 @@ static void path_pattern_match(struct pdbg_target *target, } } + /* + * If we find the same class nested which is not a match, + * then stop recursion + */ + if (level > 0 && !strcmp(tok, pats[level-1].prefix)) { + if (pats[level-1].match_index) { + int index = pdbg_target_index(target); + + if (pats[level-1].index[index] != 1) + return; + } + } + end: pdbg_for_each_child_target(target, child) { path_pattern_match(child, pats, max_levels, next);