From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4DCF642CA7; Tue, 13 Jun 2023 18:59:48 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CF64E42C24; Tue, 13 Jun 2023 18:59:26 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2043.outbound.protection.outlook.com [40.107.223.43]) by mails.dpdk.org (Postfix) with ESMTP id 69DC942D13 for ; Tue, 13 Jun 2023 18:59:24 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=T9EWjGsV4LJAgUbK9Idhv2WvA+rhPOzRuMik8c88RgRog7pTGWg8n+MVzAGx9FeQxoCVUnBxONPboY7TLmuYC/mAqbqPfrfjZJqu/F3ukw6kWgSUNmo+X2/4twkHXwkdnlA0xoVgdSEDrAAZcS08TCw2ADYWyha3Ef1Y5//a72n9am+nsTMuQJXcxTcD1u2QdAqSx1MrqKCpmXyG3ykJzsQLvxRd+yGSvRVv8ZXxjV56ttc+4Yd/f3tgoHVvoLkZgusebxq2vk+nVRjHMn9wd7HEVekXtVPyS/UZDGoMxv8PFNJVmMM462s/KscgX96JDqGZsMouAR05uEqy8fqLkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=WkNGOBOviwhxhqyOxku/SGMP9tcmir4SFe/Lpf45Le4=; b=RgoxrTk5cnnDXjEgBAkXvogSpW1TaVa3XfFYZLh0DZMWH8mhxg0akx3VLKd/e6yD6jEN1NneOD/oFdS7C/twK0paMbV9MqLSI/HJnbJTGXMfuNXqQxO9/Wxd5S3X+HHGPQC4p36gawgChccY1OfavpCz3MnTFs24cl/B1DBQppQ2q+/X7MzFG56Qa6T9oPEf33ak9jGfW45u4DtzsJFkYp3OCFjJfGRcI7V4iH1lkkGglwY5+UFGyqAJ0IeYrEztL9A71IwKc5LRJu4hbkdtdUXT7iyn5bxncByn2sluXDE6cFzUezq9gs58G/AZ9cQi7UEaEOXCL4eHQWKdXtY26Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WkNGOBOviwhxhqyOxku/SGMP9tcmir4SFe/Lpf45Le4=; b=nGUN5onVWSlt828nhD69MFYJXgvyKDbKmX9H+Og4v8BvHAyeGYB3jwbTtqjrzf5sOjKU7BRDfsDRgXB663FLWdvd6TkyMIhNLRSqu0wibOoIEqK6mmoXYCY2p8nOrAxa4VUl4yjR5scubEZzhgXXTmUcps/9qKEDd+GRPxfiFOj0l2iiqlCYdJMIpkHoQtZXJCAsZYBA04dYJ5NwaUfgheEAktMC+sN2L/7SvvGnNv4A5vCgjKxa4jRaRiLp/KmYB/QYOkBSdRq4g5tIx3lcZzld1Njmhuk4toC1I/pnLlcmzL1D7q0DAmldJBkuJCH6MeL01QdyjFD2CZz3QDs+rg== Received: from BN9PR03CA0169.namprd03.prod.outlook.com (2603:10b6:408:f4::24) by PH7PR12MB7915.namprd12.prod.outlook.com (2603:10b6:510:27c::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.33; Tue, 13 Jun 2023 16:59:22 +0000 Received: from BN8NAM11FT063.eop-nam11.prod.protection.outlook.com (2603:10b6:408:f4:cafe::ea) by BN9PR03CA0169.outlook.office365.com (2603:10b6:408:f4::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6477.35 via Frontend Transport; Tue, 13 Jun 2023 16:59:22 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by BN8NAM11FT063.mail.protection.outlook.com (10.13.177.110) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.23 via Frontend Transport; Tue, 13 Jun 2023 16:59:22 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Tue, 13 Jun 2023 09:59:03 -0700 Received: from nvidia.com (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Tue, 13 Jun 2023 09:59:02 -0700 From: Viacheslav Ovsiienko To: Subject: [PATCH v2 1/5] app/testpmd: add trace save command Date: Tue, 13 Jun 2023 19:58:41 +0300 Message-ID: <20230613165845.19109-2-viacheslavo@nvidia.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20230613165845.19109-1-viacheslavo@nvidia.com> References: <20230420100803.494-1-viacheslavo@nvidia.com> <20230613165845.19109-1-viacheslavo@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT063:EE_|PH7PR12MB7915:EE_ X-MS-Office365-Filtering-Correlation-Id: d32ea677-75dc-469a-8441-08db6c2f894d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TPJ0lBVQwVNRZ7Ml/GCjpFfXN7SsIcprDUqoAqeSodD27o8MfUMJsbPzsEBLAJjx7dg6dfPpUEFzHzjhMxxZYOW/uEqC2/yrWGRHFuoe5fypPYRTUwWfJjOCfBVqFEZvNkOlCLjyFT/EPoVKZdqg99tsFllVMEDSTdKr3UeFCfnPnOTcca9UzT2YYmd+3GTCW2D70lluqxi1ltyA43+iiF4ikcaUNH1rhkA3mwDOnmjYvhVAfBDsx1C6CIO9li1p+7CvwbERrn34DjBXc0cWfavnSoCJlLtSLA9ZYnbLE2baHbi6j+NSVQQqhDVzxI2f/5uksk4McGGgCQha5Iyiumn7/xmRLQiF4CW6xYYzeOhNs8yc/x+MmzLHscsMvShCPE9a7uSiD0zOGCaIXak2CqlhjxJN7mxJIr2oMzypnkLFxYJsYF2730t/9QVUhbWu4uxtN85hgMgXxpdLqzmd6pQQi36PPszv5TIpbIpxdU5PewXjo1tUZgJg+lrDFYUepu5Etyr7cm5U2HzLIHsfe8jtnw+jlq0QenqbpcjUrAXVQFZRG8LZkzq5BX6ck9AVxjnSI/m968g6z9RnPxmEW9JifamLQ1Zl+N92nS9e8+yHCsDE4ne9FR5j15YRbTrju8TYIBa0OZlfmiPF+p7Moj5B5I7Q/X9Z8dSGMeO/YXTme3HtZ0IvZ0sMYQtF+3DPKh91gyRZnvYpe6jv/bkxoy1t4qeM/JwG6rnFcJqLWyXTVlctlZvmRI7lahzRTyif X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230028)(4636009)(346002)(39860400002)(376002)(136003)(396003)(451199021)(36840700001)(46966006)(40470700004)(356005)(8676002)(7636003)(40460700003)(6916009)(316002)(8936002)(86362001)(36756003)(41300700001)(5660300002)(82310400005)(40480700001)(55016003)(2906002)(70586007)(2616005)(6666004)(26005)(70206006)(336012)(426003)(1076003)(7696005)(16526019)(186003)(47076005)(6286002)(36860700001)(82740400003)(478600001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jun 2023 16:59:22.2285 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d32ea677-75dc-469a-8441-08db6c2f894d X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT063.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB7915 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org The "save_trace" CLI command is added to trigger saving the trace dumps to the trace directory. Signed-off-by: Viacheslav Ovsiienko --- app/test-pmd/cmdline.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index a15a442a06..db71ce2028 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -39,6 +39,7 @@ #include #endif #include +#include #include #include @@ -12745,6 +12746,40 @@ static cmdline_parse_inst_t cmd_config_tx_affinity_map = { }, }; +#ifndef RTE_EXEC_ENV_WINDOWS +/* *** SAVE_TRACE *** */ + +struct cmd_save_trace_result { + cmdline_fixed_string_t save; +}; + +static void cmd_save_trace_parsed(__rte_unused void *parsed_result, + __rte_unused struct cmdline *cl, + __rte_unused void *data) +{ + int rc; + + rc = rte_trace_save(); + if (rc) + printf("Save trace failed with error: %d\n", rc); + else + printf("Trace saved successfully\n"); +} + +static cmdline_parse_token_string_t cmd_save_trace_save = + TOKEN_STRING_INITIALIZER(struct cmd_save_trace_result, save, "save_trace"); + +static cmdline_parse_inst_t cmd_save_trace = { + .f = cmd_save_trace_parsed, + .data = NULL, + .help_str = "save_trace: save tracing buffer", + .tokens = { + (void *)&cmd_save_trace_save, + NULL, + }, +}; +#endif + /* ******************************************************************************** */ /* list of instructions */ @@ -12979,6 +13014,9 @@ static cmdline_parse_ctx_t builtin_ctx[] = { (cmdline_parse_inst_t *)&cmd_show_port_cman_config, (cmdline_parse_inst_t *)&cmd_set_port_cman_config, (cmdline_parse_inst_t *)&cmd_config_tx_affinity_map, +#ifndef RTE_EXEC_ENV_WINDOWS + (cmdline_parse_inst_t *)&cmd_save_trace, +#endif NULL, }; -- 2.18.1