From patchwork Thu May 27 05:08:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guzowski Adrian X-Patchwork-Id: 1484421 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=exatel.pl header.i=@exatel.pl header.a=rsa-sha256 header.s=mail header.b=Ya9xN0AD; dkim-atps=neutral Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) (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 4FrG7Z3sSPz9sT6 for ; Thu, 27 May 2021 15:08:58 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id DAC9640230; Thu, 27 May 2021 05:08:52 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id baShKWqKQz81; Thu, 27 May 2021 05:08:51 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp4.osuosl.org (Postfix) with ESMTP id 9B191401E5; Thu, 27 May 2021 05:08:50 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 688B2C000E; Thu, 27 May 2021 05:08:50 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 18A1CC0001 for ; Thu, 27 May 2021 05:08:49 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 141146078B for ; Thu, 27 May 2021 05:08:49 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp3.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=exatel.pl Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id j6vTDgjm6kPS for ; Thu, 27 May 2021 05:08:48 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from seg-perk.exatel.pl (seg-perk.exatel.pl [195.136.20.206]) by smtp3.osuosl.org (Postfix) with ESMTPS id 3B1E860733 for ; Thu, 27 May 2021 05:08:48 +0000 (UTC) Received: from slpapp023.ad.exatel.pl (unknown [192.168.95.23]) by seg-perk.exatel.pl (MTA) with ESMTP id 4FrG7L1Lhjz2pGm for ; Thu, 27 May 2021 07:08:46 +0200 (CEST) Received: from SWPAPP2003.ad.exatel.pl (unknown [192.168.95.185]) by slpapp023.ad.exatel.pl (Postfix) with ESMTP id 19009405740 for ; Thu, 27 May 2021 07:08:46 +0200 (CEST) Received: from SWPAPP2001.ad.exatel.pl (192.168.95.183) by SWPAPP2003.ad.exatel.pl (192.168.95.185) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Thu, 27 May 2021 07:08:45 +0200 Received: from SWPAPP2001.ad.exatel.pl ([fe80::f04c:4a57:7d08:48ff]) by SWPAPP2001.ad.exatel.pl ([fe80::f04c:4a57:7d08:48ff%5]) with mapi id 15.01.2176.014; Thu, 27 May 2021 07:08:45 +0200 To: "dev@openvswitch.org" Thread-Topic: [PATCH v2] Add support for gdbserver in ovs-sandbox script Thread-Index: AQHXUrZea6DaQdI1lUCYpGfbvOTMRw== Date: Thu, 27 May 2021 05:08:45 +0000 Message-ID: Accept-Language: pl-PL, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [192.168.157.31] x-c2processedorg: c1cbd27c-e2bd-4ee0-b00a-619935df9462 Content-ID: X-Content-Scanned: Fidelis Mail MIME-Version: 1.0 x-msw-jemd-newsletter: false DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=exatel.pl; s=mail; t=1622092126; bh=FohTqQsRrIwkUwnabhxBv0ewHVVXD5mIIgHxbs1vDzk=; h=From:To:Subject:Thread-Topic:Thread-Index:Date:Message-ID: Accept-Language:Content-Language:Content-Type:Content-ID: Content-Transfer-Encoding:MIME-Version; b=Ya9xN0AD6guu1NWstCLJ3BQxiRsiB+iyWA3CFB+ZoIcvX9o1dxxsPyOLa69oLKw7C g7NVTj80LxZY5uPd2lQ7t/d5/tO1/YEpvy7mYe2jgd1bWB1tY91Z+E7h8a+C2r5Gz3 XxEFbZiKgB2G6Kn5BPMe/2DLpBuQBw6UYvU2hTYhJB45n0/fDz3Wzht08pqvpkUoGp CY0yautuClrCh5QZlus+CvOFDVzYV/zPcSdM9XN22vT88a3Lw1BONcWmrJhfFw1wBB e2A5TQosEVJun85vOLxPB34Ejynq1AI6yUr2MhxdJB8lH2e7qr2/t2bFjJslDZwaHh 9KUBjDAFVLhGg== Subject: [ovs-dev] [PATCH v2] Add support for gdbserver in ovs-sandbox script X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Guzowski Adrian via dev From: Guzowski Adrian Reply-To: Guzowski Adrian Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Using gdbserver instead of plain gdb allows two new use cases: 1. Ability to debug vSwitch running on remote/virtual machines 2. Ability to debug vSwitch with IDE (tested on CLion) Signed-off-by: Guzowski Adrian --- tutorial/ovs-sandbox | 51 +++++++++++++++++++++++++++++--------------- 1 file changed, 34 insertions(+), 17 deletions(-) cat <&2 exit 1 @@ -271,7 +286,8 @@ trap 'kill `cat "$sandbox"/*.pid`' 0 1 2 3 13 14 15 touch "$sandbox"/.conf.db.~lock~ run ovsdb-tool create conf.db "$schema" ovsdb_server_args= -rungdb $gdb_ovsdb $gdb_ovsdb_ex ovsdb-server --detach --no-chdir --pidfile -vconsole:off --log-file -vsyslog:off \ +rungdb $gdb_ovsdb $gdb_ovsdb_ex "$gdbserver_addr" ovsdb-server --detach \ + --no-chdir --pidfile -vconsole:off --log-file -vsyslog:off \ --remote=punix:"$sandbox"/db.sock \ --remote=db:Open_vSwitch,Open_vSwitch,manager_options \ $ovsdb_server_args @@ -292,7 +308,8 @@ fi run ovs-vsctl --no-wait -- init # Start ovs-vswitchd. -rungdb $gdb_vswitchd $gdb_vswitchd_ex ovs-vswitchd --detach --no-chdir --pidfile -vconsole:off -- log-file -vsyslog:off \ +rungdb $gdb_vswitchd $gdb_vswitchd_ex "$gdbserver_addr" ovs-vswitchd --detach \ + --no-chdir --pidfile -vconsole:off --log-file -vsyslog:off \ --enable-dummy=$dummy -vvconn -vnetdev_dummy