From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id ED52AA00C2; Wed, 22 Apr 2020 21:07:27 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A26AE1D658; Wed, 22 Apr 2020 21:05:33 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 0CE831D419 for ; Wed, 22 Apr 2020 21:05:10 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 03MIxZd7013066; Wed, 22 Apr 2020 12:05:10 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0818; bh=zIsC/Wt1I/hz/xDMx2mJ0jV8MrTcG7k8CvZXu+J22HU=; b=EXR9d6vViydSiLMQfy46oO7dBz0PxZ30cTN881pULwwx8QWh10DTlO4RH0Y8a96N8nOH iGPGc4OG1yaowa5p5gUDp7ucimk+A9LwNuo6G+z5dq0mTV7gXjLOcAj40jS0LviCXsQN XIKs7Do6L/3kPmzeSwEg6Tsg6Mz29e1VTaZ7+4ctUXe2bw5SWqVMGIB0ksir2WQsbwkk 9VhEdqaHqHsF0kPlcoopo+/dXPK15IGHk1GjqSnUxd85/iEVhU/lEd68xO3GS8nf9r8m 5CFqlUa3lMPPgfSEeYw6oFSZP/MmSh6V/leBy2xKEvEtlefzaEneCknq+V8g88UNaAyY Yg== Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0a-0016f401.pphosted.com with ESMTP id 30fxwpk01w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 22 Apr 2020 12:05:10 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 22 Apr 2020 12:05:08 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 22 Apr 2020 12:05:07 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 22 Apr 2020 12:05:07 -0700 Received: from jerin-lab.marvell.com (jerin-lab.marvell.com [10.28.34.14]) by maili.marvell.com (Postfix) with ESMTP id A6C643F7048; Wed, 22 Apr 2020 12:05:05 -0700 (PDT) From: To: Jerin Jacob , Sunil Kumar Kori , Bruce Richardson CC: , , , Date: Thu, 23 Apr 2020 00:33:37 +0530 Message-ID: <20200422190349.3768487-21-jerinj@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200422190349.3768487-1-jerinj@marvell.com> References: <20200419100133.3232316-1-jerinj@marvell.com> <20200422190349.3768487-1-jerinj@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.676 definitions=2020-04-22_06:2020-04-22, 2020-04-22 signatures=0 Subject: [dpdk-dev] [PATCH v7 20/32] eal/trace: add thread tracepoints X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Jerin Jacob Add the following thread related tracepoints. - rte_trace_lib_eal_thread_remote_launch() - rte_trace_lib_eal_thread_lcore_ready() Signed-off-by: Jerin Jacob --- lib/librte_eal/common/eal_common_trace_points.c | 8 ++++++++ lib/librte_eal/freebsd/eal_interrupts.c | 2 +- lib/librte_eal/freebsd/eal_thread.c | 12 ++++++++---- lib/librte_eal/include/rte_eal_trace.h | 17 +++++++++++++++++ lib/librte_eal/linux/eal_thread.c | 12 ++++++++---- lib/librte_eal/rte_eal_version.map | 2 ++ 6 files changed, 44 insertions(+), 9 deletions(-) diff --git a/lib/librte_eal/common/eal_common_trace_points.c b/lib/librte_eal/common/eal_common_trace_points.c index 0192d1eb6..785fb3ada 100644 --- a/lib/librte_eal/common/eal_common_trace_points.c +++ b/lib/librte_eal/common/eal_common_trace_points.c @@ -35,6 +35,9 @@ RTE_TRACE_POINT_DEFINE(rte_eal_trace_memzone_reserve); RTE_TRACE_POINT_DEFINE(rte_eal_trace_memzone_lookup); RTE_TRACE_POINT_DEFINE(rte_eal_trace_memzone_free); +RTE_TRACE_POINT_DEFINE(rte_eal_trace_thread_remote_launch); +RTE_TRACE_POINT_DEFINE(rte_eal_trace_thread_lcore_ready); + RTE_INIT(eal_trace_init) { RTE_TRACE_POINT_REGISTER(rte_eal_trace_generic_void, @@ -90,4 +93,9 @@ RTE_INIT(eal_trace_init) lib.eal.memzone.lookup); RTE_TRACE_POINT_REGISTER(rte_eal_trace_memzone_free, lib.eal.memzone.free); + + RTE_TRACE_POINT_REGISTER(rte_eal_trace_thread_remote_launch, + lib.eal.thread.remote.launch); + RTE_TRACE_POINT_REGISTER(rte_eal_trace_thread_lcore_ready, + lib.eal.thread.lcore.ready); } diff --git a/lib/librte_eal/freebsd/eal_interrupts.c b/lib/librte_eal/freebsd/eal_interrupts.c index 00991f26a..7def3189b 100644 --- a/lib/librte_eal/freebsd/eal_interrupts.c +++ b/lib/librte_eal/freebsd/eal_interrupts.c @@ -85,7 +85,7 @@ rte_intr_callback_register(const struct rte_intr_handle *intr_handle, { struct rte_intr_callback *callback; struct rte_intr_source *src; - int ret, add_event = 0; + int ret = 0, add_event = 0; /* first do parameter checking */ if (intr_handle == NULL || intr_handle->fd < 0 || cb == NULL) { diff --git a/lib/librte_eal/freebsd/eal_thread.c b/lib/librte_eal/freebsd/eal_thread.c index c25b4a019..b52019782 100644 --- a/lib/librte_eal/freebsd/eal_thread.c +++ b/lib/librte_eal/freebsd/eal_thread.c @@ -20,8 +20,7 @@ #include #include #include -#include -#include +#include #include "eal_private.h" #include "eal_thread.h" @@ -42,9 +41,10 @@ rte_eal_remote_launch(int (*f)(void *), void *arg, unsigned slave_id) char c = 0; int m2s = lcore_config[slave_id].pipe_master2slave[1]; int s2m = lcore_config[slave_id].pipe_slave2master[0]; + int rc = -EBUSY; if (lcore_config[slave_id].state != WAIT) - return -EBUSY; + goto finish; lcore_config[slave_id].f = f; lcore_config[slave_id].arg = arg; @@ -64,7 +64,10 @@ rte_eal_remote_launch(int (*f)(void *), void *arg, unsigned slave_id) if (n <= 0) rte_panic("cannot read on configuration pipe\n"); - return 0; + rc = 0; +finish: + rte_eal_trace_thread_remote_launch(f, arg, slave_id, rc); + return rc; } /* set affinity for current thread */ @@ -127,6 +130,7 @@ eal_thread_loop(__rte_unused void *arg) lcore_id, thread_id, cpuset, ret == 0 ? "" : "..."); __rte_trace_mem_per_thread_alloc(); + rte_eal_trace_thread_lcore_ready(lcore_id, cpuset); /* read on our pipe to get commands */ while (1) { diff --git a/lib/librte_eal/include/rte_eal_trace.h b/lib/librte_eal/include/rte_eal_trace.h index f100f9185..72d4ede08 100644 --- a/lib/librte_eal/include/rte_eal_trace.h +++ b/lib/librte_eal/include/rte_eal_trace.h @@ -205,6 +205,23 @@ RTE_TRACE_POINT( rte_trace_point_emit_int(rc); ) +/* Thread */ +RTE_TRACE_POINT( + rte_eal_trace_thread_remote_launch, + RTE_TRACE_POINT_ARGS(int (*f)(void *), void *arg, + unsigned int slave_id, int rc), + rte_trace_point_emit_ptr(f); + rte_trace_point_emit_ptr(arg); + rte_trace_point_emit_u32(slave_id); + rte_trace_point_emit_int(rc); +) +RTE_TRACE_POINT( + rte_eal_trace_thread_lcore_ready, + RTE_TRACE_POINT_ARGS(unsigned int lcore_id, const char *cpuset), + rte_trace_point_emit_u32(lcore_id); + rte_trace_point_emit_string(cpuset); +) + #ifdef __cplusplus } diff --git a/lib/librte_eal/linux/eal_thread.c b/lib/librte_eal/linux/eal_thread.c index 24772fc3d..cd9d6e0eb 100644 --- a/lib/librte_eal/linux/eal_thread.c +++ b/lib/librte_eal/linux/eal_thread.c @@ -20,8 +20,7 @@ #include #include #include -#include -#include +#include #include "eal_private.h" #include "eal_thread.h" @@ -42,9 +41,10 @@ rte_eal_remote_launch(int (*f)(void *), void *arg, unsigned slave_id) char c = 0; int m2s = lcore_config[slave_id].pipe_master2slave[1]; int s2m = lcore_config[slave_id].pipe_slave2master[0]; + int rc = -EBUSY; if (lcore_config[slave_id].state != WAIT) - return -EBUSY; + goto finish; lcore_config[slave_id].f = f; lcore_config[slave_id].arg = arg; @@ -64,7 +64,10 @@ rte_eal_remote_launch(int (*f)(void *), void *arg, unsigned slave_id) if (n <= 0) rte_panic("cannot read on configuration pipe\n"); - return 0; + rc = 0; +finish: + rte_eal_trace_thread_remote_launch(f, arg, slave_id, rc); + return rc; } /* set affinity for current EAL thread */ @@ -127,6 +130,7 @@ eal_thread_loop(__rte_unused void *arg) lcore_id, (uintptr_t)thread_id, cpuset, ret == 0 ? "" : "..."); __rte_trace_mem_per_thread_alloc(); + rte_eal_trace_thread_lcore_ready(lcore_id, cpuset); /* read on our pipe to get commands */ while (1) { diff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map index 22455c7c0..83fb686f4 100644 --- a/lib/librte_eal/rte_eal_version.map +++ b/lib/librte_eal/rte_eal_version.map @@ -382,4 +382,6 @@ EXPERIMENTAL { __rte_trace_lib_eal_memzone_free; __rte_trace_lib_eal_memzone_lookup; __rte_trace_lib_eal_memzone_reserve; + __rte_trace_lib_eal_thread_lcore_ready; + __rte_trace_lib_eal_thread_remote_launch; }; -- 2.25.1