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 63DB7423AE; Wed, 11 Jan 2023 15:32:50 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0A15D40E25; Wed, 11 Jan 2023 15:32:50 +0100 (CET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id E8E0C40A7D for ; Wed, 11 Jan 2023 15:32:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673447568; x=1704983568; h=date:from:to:cc:subject:message-id:references: content-transfer-encoding:in-reply-to:mime-version; bh=KLMurKAeG7IP7Vq8ER8KziJhcHp8Q3l3p4vEtVT/YW8=; b=hPTyY6DoMzyC0QOkfql5EffFMRVd6Xc7IYWlK1D7frjFoEtreRENFrif 1VNqLIZNqL4McZhYsl2YBy8QGd5HlpkFa+6y+lPVrv3SVF7jQYrGLoeF/ n8q06NTO/1I0wRumG3gUua6/R9uIwVQ7y8erAYDl7fbEwg/NjtcCArGpQ iR8I+7WcsH7DGSyCjspsdcN10aLB1mBzNRjyEYzt77EFXXoXCVt/tuQ5s oeZekHVLBeD04ROQwBAZE7RJUvO9kZb6nZP5vEqbjtRHrD7VzCZ+4jqvM 8Bx/CjMsPOD+jIsaq3HfXszNkF23/O3wWmd3ZpM6SoZdR0EpUMARG5Z3f Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10586"; a="303121875" X-IronPort-AV: E=Sophos;i="5.96,317,1665471600"; d="scan'208";a="303121875" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2023 06:32:46 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10586"; a="657434147" X-IronPort-AV: E=Sophos;i="5.96,317,1665471600"; d="scan'208";a="657434147" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by orsmga002.jf.intel.com with ESMTP; 11 Jan 2023 06:32:46 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Wed, 11 Jan 2023 06:32:45 -0800 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16 via Frontend Transport; Wed, 11 Jan 2023 06:32:45 -0800 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (104.47.56.49) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Wed, 11 Jan 2023 06:32:44 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k7ozvmxelr8Nmwl0PIb0vG3ttxAgsTIInvm7b6AqGmPOKXHzPwDDxdpruXL3fWw+HW8rchaEau8Fj60BnBhcLt2EeVra0oDF5p5lv9XEh7NCGLqnRX/kcUtjY2ZWUykvDVEjMgh0uWcOpycL+O8DR4oqFBu6VieuUDh1nKunb7/YsN1kqEDbd9hok792WI7jiwh4wHgfmjOFyA8TujCffSIGvcKmhW+r0rqIehUkl2MvaJlyxE5k1bpkPBkkPwjv/8ieFFw44LSeWkGR5AWp9QTJTJke/5tFlHyOnWD7iMKEJCxoBhslaELUsYSlZTJ9vHksDcUMwxkPvpQV+L4tlg== 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=LTDHTtJ/C3lgzejA7qTWcPTVQC2KO85K6Ef3UxIS8sw=; b=Gq93BBcqZiqC+PDhqadpVgz4EfB4pqm0CGqvaNSNTUTN64Q6hVhEcLhTNHtCUWRbgEZ20Be6Cg/U/S0qCo7QGSDuJzgSFrzHJQqkfFBIv6TdpGshzC2+l46HQPH5VkvCfZEWPrauf6Ue1UXnw4RGIJUoOiW7sObNJ2qKWMQ5p+OJgKHzEpjVcmHAKLbWm2myP0RiAV2lCbfX9O/+mVdR8JjAlJ5emFmbySjUKlazbV8WgzbRcejYOPSqUaPQU4xXX/DzwdHZbC7pv/Ro5Q8Jju6wly/PmZyecDDN9zXY3ToywD77PdAOqWS7BaEHPhV1kd6orLejPpex8BvRhbvZTQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) by IA0PR11MB7187.namprd11.prod.outlook.com (2603:10b6:208:441::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Wed, 11 Jan 2023 14:32:40 +0000 Received: from DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::4d9f:6867:2d53:9ee]) by DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::4d9f:6867:2d53:9ee%8]) with mapi id 15.20.5986.018; Wed, 11 Jan 2023 14:32:40 +0000 Date: Wed, 11 Jan 2023 14:32:33 +0000 From: Bruce Richardson To: Tomasz Duszynski CC: Morten =?iso-8859-1?Q?Br=F8rup?= , "Tyler Retzlaff" , "dev@dpdk.org" , "thomas@monjalon.net" , Jerin Jacob Kollanukkaran , "Ruifeng.Wang@arm.com" , "mattias.ronnblom@ericsson.com" , "zhoumin@loongson.cn" Subject: Re: [PATCH v5 0/4] add support for self monitoring Message-ID: References: <20221213104350.3218167-1-tduszynski@marvell.com> <20230110234642.1188550-1-tduszynski@marvell.com> <20230111003222.GA24460@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> <98CBD80474FA8B44BF855DF32C47DC35D8764E@smartserver.smartshare.dk> Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-ClientProxiedBy: LO2P265CA0318.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a4::18) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|IA0PR11MB7187:EE_ X-MS-Office365-Filtering-Correlation-Id: 1cb42a0b-2c1d-4f10-45c6-08daf3e0b18f X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +fFTDOTx5Vl6gG1a4tFXiDsHTimXBWmiOd/nQFCv6vDfNBwLxqsiiNMhlaYKsTLlln0W2aDYsDEzqrkDbQA7cvSXefNKJgCDeB10wmIUxOV1li9E0VsHPmrShaXNinsY9evfFPjAiIZl3tZXcQ9O1CmuL1fl6RrmD3JQ05gaS7WSGtNhzsdb6tlEikzl2b+YRFFRn3yxJVLjJxXDy+lEWWhB/sRZasyZ1Ih62I6BKFDIGuu8CGmDp6iOFuievd6VrblglpL1i+nG2dWjA9hab2Ek13OFMoaAnqodfBioraBggACSycbcExSTKHghGNiTTPi5L2Gvi9oMC5MIkfAlMtR8XUgV/oS0afKJ35OUI22zQC1yS413h2Sd+ihiyITg20ixdTV4qDOfBl+LlcR/9VpKcLMPk/03AfoAqZyj07R5TiiNuwtvoDy+8B5seuwL6jKjw/tQL9ka0+dne/VzBcIgGpsRNmqBuxOMMLZWR1F9FGHvLVEe4DHTD4BSCYHOcF2c+/ufzENRBeO9P1b2i/GkLVi2WL6ZQs3MpL65rRXTxZZAOUqC3L5VOYv0PN8sIjWBgLKSLmwn+TrEpU3JiA093TIkGs0gZzlGfk8ANnbf06tUpKvXLHZmbtfjnChyJeIXmBV7WBcwtZBNqVv9v+p0cotdWAokXM1gJGcUwSvAemlvxczgEk1eEW6wxhNqJ+1rrp0GNjL3YAaKF1XbRw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DS0PR11MB7309.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(396003)(376002)(346002)(39860400002)(136003)(366004)(451199015)(66476007)(4326008)(8676002)(66946007)(66556008)(26005)(41300700001)(5660300002)(8936002)(478600001)(186003)(38100700002)(966005)(6506007)(6666004)(86362001)(66574015)(316002)(6486002)(82960400001)(45080400002)(6916009)(6512007)(54906003)(2906002)(83380400001)(44832011); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?iso-8859-1?Q?JgGL4tSkKb1iMAHL+vDOvoVtyFDKb5XoP2HHqgea+dQ8u+ekvVWsqIfmSf?= =?iso-8859-1?Q?ABGxCTKeX6elJfLOfrHp0wSceKD32XGV546dVMQQaKFs6aEQiAFiIonxR5?= =?iso-8859-1?Q?JaOMaaxLLPY0h5HuqC3Oq5nW+a4NS4kAqEH9lpU26cJkgjuRu49fMD25l8?= =?iso-8859-1?Q?f6Jb3F4VKmQ+1nGo+A+mJfMTz9pPMPhI0YzBoSBMKTc0zET7u3942Dj12p?= =?iso-8859-1?Q?Pc/eUG95IGGSheqdGDOmI7POp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?Q?F92A27UcSlyDIERBcmBKGUW3u+3I+SmRn+xW8lOOHZhJn1LCx9hdWDHqYq?= =?iso-8859-1?Q?noK2OZxaHKsvzsLRM6Sf9BREdUClgWXT4eKWnVI0aIu+0fV2grJqS6cEiQ?= =?iso-8859-1?Q?qY7BAdbuzGalI6lE3sgj6LPbyX8ptFHehsYJ9s5ZXby4Rh9ZiD8N7tCyDA?= =?iso-8859-1?Q?i4O4BO1CVHSa0k+tl7VfqlIsMVjl1QMesCyqvQoaipU6+X9q1LcLoFNyAW?= =?iso-8859-1?Q?E1YF7eY4ZEqkQnnOPWSSFz1LW5PZShK1EcVBlEFjOJPwjzQo50Y/6JLs7M?= =?iso-8859-1?Q?c7fP3doIHejNg8lCuS9ugde70IW76nRfko61+iEdecbWu6T0Q6PqRrf/an?= =?iso-8859-1?Q?4uDWYMJ5zvm+6YtF+Vt4TbkoOkg9hv4rRsJ0KpCbrg0LmXZ01IAkjgzPTP?= =?iso-8859-1?Q?m9l2Yenrn3fpdCyafLZKdkh+sZIhI6LfEEwK1lnqpGq+1Sj1YW97ATu0Od?= =?iso-8859-1?Q?aDvudrHEnFXCzEqHkAOu6vwhKDUsp320coRDphPiLXCQ3PCOgOpkRbgw?= =?iso-8859-1?Q?=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 1cb42a0b-2c1d-4f10-45c6-08daf3e0b18f X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jan 2023 14:32:40.5714 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: qaLxMkiZvMHn22VZ8YRNZ884HAUNScQJ38KUJY85e3wEb78uVIhw+0+HN1Aw5D8nZIZ0XIiGlPOsuaVCM1aEeJemBcqBhxwcOnOfUaMTyT0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR11MB7187 X-OriginatorOrg: intel.com 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 On Wed, Jan 11, 2023 at 02:24:28PM +0000, Tomasz Duszynski wrote: > > > >-----Original Message----- > >From: Morten Brørup > >Sent: Wednesday, January 11, 2023 10:31 AM > >To: Tyler Retzlaff ; Tomasz Duszynski ; > >bruce.richardson@intel.com > >Cc: dev@dpdk.org; thomas@monjalon.net; Jerin Jacob Kollanukkaran ; > >Ruifeng.Wang@arm.com; mattias.ronnblom@ericsson.com; zhoumin@loongson.cn > >Subject: [EXT] RE: [PATCH v5 0/4] add support for self monitoring > > > >External Email > > > >---------------------------------------------------------------------- > >> From: Tyler Retzlaff [mailto:roretzla@linux.microsoft.com] > >> Sent: Wednesday, 11 January 2023 01.32 > >> > >> On Wed, Jan 11, 2023 at 12:46:38AM +0100, Tomasz Duszynski wrote: > >> > This series adds self monitoring support i.e allows to configure and > >> > read performance measurement unit (PMU) counters in runtime without > >> > using perf utility. This has certain adventages when application > >> > runs > >> on > >> > isolated cores with nohz_full kernel parameter. > >> > > >> > Events can be read directly using rte_pmu_read() or using dedicated > >> > tracepoint rte_eal_trace_pmu_read(). The latter will cause events to > >> be > >> > stored inside CTF file. > >> > > >> > By design, all enabled events are grouped together and the same > >> > group is attached to lcores that use self monitoring funtionality. > >> > > >> > Events are enabled by names, which need to be read from standard > >> > location under sysfs i.e > >> > > >> > /sys/bus/event_source/devices/PMU/events > >> > > >> > where PMU is a core pmu i.e one measuring cpu events. As of today > >> > raw events are not supported. > >> > > >> > v5: > >> > - address review comments > >> > - fix sign extension while reading pmu on x86 > >> > - fix regex mentioned in doc > >> > - various minor changes/improvements here and there > >> > v4: > >> > - fix freeing mem detected by debug_autotest > >> > v3: > >> > - fix shared build > >> > v2: > >> > - fix problems reported by test build infra > >> > > >> > Tomasz Duszynski (4): > >> > eal: add generic support for reading PMU events > >> > eal/arm: support reading ARM PMU events in runtime > >> > eal/x86: support reading Intel PMU events in runtime > >> > eal: add PMU support to tracing library > >> > > >> > app/test/meson.build | 1 + > >> > app/test/test_pmu.c | 47 +++ > >> > app/test/test_trace_perf.c | 4 + > >> > doc/guides/prog_guide/profile_app.rst | 13 + > >> > doc/guides/prog_guide/trace_lib.rst | 32 ++ > >> > lib/eal/arm/include/meson.build | 1 + > >> > lib/eal/arm/include/rte_pmu_pmc.h | 39 ++ > >> > lib/eal/arm/meson.build | 4 + > >> > lib/eal/arm/rte_pmu.c | 104 +++++ > >> > lib/eal/common/eal_common_trace_points.c | 3 + > >> > lib/eal/common/meson.build | 3 + > >> > lib/eal/common/pmu_private.h | 41 ++ > >> > lib/eal/common/rte_pmu.c | 504 > >> +++++++++++++++++++++++ > >> > lib/eal/include/meson.build | 1 + > >> > lib/eal/include/rte_eal_trace.h | 10 + > >> > lib/eal/include/rte_pmu.h | 202 +++++++++ > >> > lib/eal/linux/eal.c | 4 + > >> > lib/eal/version.map | 7 + > >> > lib/eal/x86/include/meson.build | 1 + > >> > lib/eal/x86/include/rte_pmu_pmc.h | 33 ++ > >> > 20 files changed, 1054 insertions(+) create mode 100644 > >> > app/test/test_pmu.c create mode 100644 > >> > lib/eal/arm/include/rte_pmu_pmc.h create mode 100644 > >> > lib/eal/arm/rte_pmu.c create mode 100644 > >> > lib/eal/common/pmu_private.h create mode 100644 > >> > lib/eal/common/rte_pmu.c create mode 100644 > >> > lib/eal/include/rte_pmu.h create mode 100644 > >> > lib/eal/x86/include/rte_pmu_pmc.h > >> > > >> > -- > >> > 2.34.1 > > > >[Moved Tyler's post down here.] > > > >> > >> hi, > >> > >> don't interpret this as an objection to the functionality but this > >> looks like a clear example of something that doesn't belong in the > >> EAL. has there been a discussion as to whether or not this should be > >> in a separate library? > > > >IIRC, there has been no such discussion. > > > >Although I agree that this doesn't belong in EAL, I would point to the trace library as a reference > >for allowing it into the EAL. > > > >For the records, I also oppose to the trace library being part of the EAL. > > > >On the other hand, it would be interesting to determine if it is *impossible* adding this > >functionality as any other normal DPDK library, i.e. outside of the EAL, or if there is an > >unavoidable tie-in to the EAL. > > > >@Tomasz, if this is impossible, please describe the unavoidable tie-in to the EAL. No need for a > >long report, just a few words. You (and this functionality) shouldn't suffer from our long term > >ambition to move stuff out of the EAL. > > > > You can read about rationale here https://lore.kernel.org/dpdk-dev/DM4PR18MB436872EBC5922084C5DAFC1DD2FC9@DM4PR18MB4368.namprd18.prod.outlook.com/#t > > As for the NO-NO there isn't any in fact. There are some tradeoffs though. > > For example, seems eal cannot depend on other libs so if someone needs to > finetune some part of EAL for whatever reason, then relevant part needs to > modified each and every time. I.e specific includes and trcepoints need to be added each time. > Well, EAL can depend on other libs, but then those libs cannot in turn directly depend upon DPDK. This is where breaking out first some of the smaller widely used parts of DPDK e.g. logging, would be good, as it would then in turn allow other, potentially bigger parts of EAL to be taken out. See [1] for a rough first attempt at this, which allows simlification of telemetry as it no longer needs a "dependency injection" style to have logging. Moving out logging would also allow logging from kvargs library too - another lib which is used by EAL rather than depending on it. Similarly for tracing functionality - if that were pulled out of EAL, it could be used by telemetry, kvargs and any other parts removed from EAL. /Bruce [1] http://patches.dpdk.org/project/dpdk/list/?series=24453