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 0166AA051A; Fri, 17 Jan 2020 05:41:25 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2EB2C1D424; Fri, 17 Jan 2020 05:41:25 +0100 (CET) Received: from mail-io1-f68.google.com (mail-io1-f68.google.com [209.85.166.68]) by dpdk.org (Postfix) with ESMTP id 2A5971D422; Fri, 17 Jan 2020 05:41:23 +0100 (CET) Received: by mail-io1-f68.google.com with SMTP id i11so24532294ioi.12; Thu, 16 Jan 2020 20:41:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=F1bdivj2XhFd617vwpESzEnte5J4qYPyT3T0QQuC5os=; b=br2WDmkb7vpW5hrBwrJUrK6DiFYU92fUqB1jqSLMPokrBqMJH8cPO2baSDPK9zwRJQ 53sl6AnkXURvuHFsyZNXaRmxDbVax63sZNR0lDeJbog8OhJY0eQDft7xhqwkJSGHlORd tvikVLufESxG3aRBkZeuoZDw4iAZUSH8RHkS01sDGyJrSFC+xXBPZdKkyiLbk/Lr1lwL 9gYJoT14KTiF5MgIWom+2XcACOawSaX5wA/dFm9+y9vsis2+UpcPIExHNh6tmffb1Xgz nEiu9MfRrY3ejPiR4UfJ36krx6HjNZsQ/tT56BzB2bYFb4wvaLn86qLgZPcg27OIpcpX fzbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=F1bdivj2XhFd617vwpESzEnte5J4qYPyT3T0QQuC5os=; b=Eb757RJkTWVAiyUM7LYxMhxJdqmR91BHvDQVWglnZLlVWWTOu9bIhm68XwsoVf0jVf qZ2l+PfT/I4YthVWfq/yPvl/rf1+lQnEhh9hXw0Egvn8F2diXrXTnr/bdxM6yfWoLbgy 6Gt0D1TaABw9ctZsmYGD0lap/DvBR67LpXhnUskEZk+MCk4x/iSwrtoi2TogfJJ3Sdyu FRQwOghNuYpT4ob1a3mOrJwpqTFJA+/QJEfjS5nIFLzipujWu6QU6DNBUJZjRM0uF0sF 8Eg7Y8KXEjwUl5xTgmAjolQK/F0kS8XtJfzH+Jtr66UJyR/ANSMEOzbXh/PT6VYfh2aQ g4tw== X-Gm-Message-State: APjAAAV0qcia186BpHBOaiA+K6xfkkjwvd6/f5VG9AMgXWy0dx9KA71Q 1a5gXJsTxefaG3nZBVotFOEpKGfVxL4Arx0iFGc= X-Google-Smtp-Source: APXvYqwDwIfGXs4WzHdDK9nZNHTn6P8aO5DxCi8svMbgKGCLs5lqJXx8DWG+ArftqOLQyvBayCjK4OFLm/u4iRKJbn4= X-Received: by 2002:a5e:8516:: with SMTP id i22mr30759923ioj.130.1579236082271; Thu, 16 Jan 2020 20:41:22 -0800 (PST) MIME-Version: 1.0 References: <20200113130543.GC1645@bricha3-MOBL.ger.corp.intel.com> <20200113145823.GD1645@bricha3-MOBL.ger.corp.intel.com> <20200113161259.GE1645@bricha3-MOBL.ger.corp.intel.com> In-Reply-To: <20200113161259.GE1645@bricha3-MOBL.ger.corp.intel.com> From: Jerin Jacob Date: Fri, 17 Jan 2020 10:11:06 +0530 Message-ID: To: Bruce Richardson Cc: Jerin Jacob Kollanukkaran , "dev@dpdk.org" , Thomas Monjalon , David Marchand , Ferruh Yigit , Andrew Rybchenko , Ajit Khaparde , Qi Zhang , Xiaolong Ye , Raslan Darawsheh , Maxime Coquelin , Tiwei Bie , Akhil Goyal , Luca Boccassi , Kevin Traynor , "maintainers@dpdk.org" , John McNamara , Marko Kovacevic , Ray Kinsella , Aaron Conole , Michael Santana , Harry van Haaren , Cristian Dumitrescu , Phil Yang , Joyce Kong , =?UTF-8?Q?Mattias_R=C3=B6nnblom?= , Jan Viktorin , Gavin Hu , David Christensen , Konstantin Ananyev , Anatoly Burakov , Harini Ramakrishnan , Omar Cardona , Anand Rawat , Olivier Matz , Gage Eads , Adrien Mazarguil , Nicolas Chautru , Declan Doherty , Fiona Trahe , Ashish Gupta , Erik Gabriel Carrillo , Abhinandan Gujjar , Hemant Agrawal , "Artem V. Andreev" , Nithin Kumar Dabilpuram , Vamsi Krishna Attunuru , Rosen Xu , Sachin Saxena , Stephen Hemminger , Chas Williams , "John W. Linville" , Prasun Kapoor , Marcin Wojtas , Michal Krawczyk , Guy Tzalik , Evgeny Schemeilin , Igor Chauskin , Ravi Kumar , Igor Russkikh , Pavel Belous , Shepard Siegel , Ed Czeck , John Miller , Somnath Kotur , Maciej Czekaj , Shijith Thotton , Srisivasubramanian Srinivasan , Rahul Lakkireddy , John Daley , Hyong Youb Kim , "Wei Hu (Xavier" , "Min Hu (Connor" , Yisen Zhuang , Ziyang Xuan , Xiaoyun Wang , Guoyang Zhou , Beilei Xing , Xiao Wang , Jingjing Wu , Wenzhuo Lu , Qiming Yang , Tomasz Duszynski , Liron Himi , Zyta Szpak , Kiran Kumar Kokkilagadda , Matan Azrad , Shahaf Shuler , Viacheslav Ovsiienko , "K. Y. Srinivasan" , Haiyang Zhang , Jan Remes , Heinrich Kuhn , Jan Gutter , Gagandeep Singh , Rasesh Mody , Shahed Shaikh , Yong Wang , Zhihong Wang , Steven Webster , Matt Peters , Keith Wiles , Tetsuya Mukawa , Jasvinder Singh , Jakub Grajciar , Ruifeng Wang , Anoob Joseph , Fan Zhang , Pablo de Lara , John Griffin , Deepak Kumar Jain , Michael Shamis , Nagadheeraj Rottela , Srikanth Jampala , Ankur Dwivedi , Jay Zhou , Lee Daly , Sunila Sahu , Nipun Gupta , Liang Ma , Peter Mccarthy , Tianfei zhang , Satha Koteswara Rao Kottidi , Xiaoyun Li , Bernard Iremonger , Vladimir Medvedkin , David Hunt , Reshma Pattan , Byron Marohn , Sameh Gobriel , Yipeng Wang , Honnappa Nagarahalli , Robert Sanford , Kevin Laatz , Maryam Tahhan , Ori Kam , Radu Nicolau , Tomasz Kantecki , Sunil Kumar Kori , Pavan Nikhilesh Bhagavatula , Kirill Rybalchenko , "Kadam, Pallavi" Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [RFC] DPDK Trace support 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" > > > > > > > > Yes this is when trace is enabled. If the trace is disabled then it > > > > will be the only a handful of cycles. > > > > > > > Two follow-on questions: > > > 1. Is the trace enable/disable dynamic at runtime? > > > > Yes. See the requirement section. > > > > > 2. Have you investigated how low the "handful of cycles" actually is? > > > > Yes. it is around 1 to 3 cycles based on the arch. it boils down to > > mostly a branch hit/miss on a memory location > > embedded in a C macro. > > > That seems impressively low, which is great news! Does anyone have an objection to have 1) Use CTF as trace format to reuse the opensource tracing tools and compatibility wth LTTng https://diamon.org/ctf/ 2) Have native DPDK CTF trace emitter for better performance for DPDK fast path tracing and Non-Linux support. I would like to avoid the situation where once code gets completed and then starts our basic discussion on the design decisions. If someone needs more time to think through or any clarification is required then please discuss. See below the original RFC. -------------------------- 8<---------------------------------- Hi All, I would like to add tracing support for DPDK. I am planning to add this support in v20.05 release. This RFC attempts to get feedback from the community on a) Tracing Use cases. b) Tracing Requirements. b) Implementation choices. c) Trace format. Use-cases --------- - Most of the cases, The DPDK provider will not have access to the DPDK customer applications. To debug/analyze the slow path and fast path DPDK API usage from the field, we need to have integrated trace support in DPDK. - Need a low overhead Fast path multi-core PMD driver debugging/analysis infrastructure in DPDK to fix the functional and performance issue(s) of PMD. - Post trace analysis tools can provide various status across the system such as cpu_idle() using the timestamp added in the trace. Requirements: ------------- - Support for Linux, FreeBSD and Windows OS - Open trace format - Multi-platform Open source trace viewer - Absolute low overhead trace API for DPDK fast path tracing/debugging. - Dynamic enable/disable of trace events To enable trace support in DPDK, following items need to work out: a) Add the DPDK trace points in the DPDK source code. - This includes updating DPDK functions such as, rte_eth_dev_configure(), rte_eth_dev_start(), rte_eth_dev_rx_burst() to emit the trace. b) Choosing suitable serialization-format - Common Trace Format, CTF, is an open format and language to describe trace formats. This enables tool reuse, of which line-textual (babeltrace) and graphical (TraceCompass) variants already exist. CTF should look familiar to C programmers but adds stronger typing. See CTF - A Flexible, High-performance Binary Trace Format. https://diamon.org/ctf/ c) Writing the on-target serialization code, See the section below.(Lttng CTF trace emitter vs DPDK specific CTF trace emitter) d) Deciding on and writing the I/O transport mechanics, For performance reasons, it should be backed by a huge-page and write to file IO. e) Writing the PC-side deserializer/parser, Both the babletrace(CLI tool) and Trace Compass(GUI tool) support CTF. See: https://lttng.org/viewers/ f) Writing tools for filtering and presentation. See item (e) Lttng CTF trace emitter vs DPDK specific CTF trace emitter ---------------------------------------------------------- I have written a performance evaluation application to measure the overhead of Lttng CTF emitter(The fastpath infrastructure used by https://lttng.org/ library to emit the trace) https://github.com/jerinjacobk/lttng-overhead https://github.com/jerinjacobk/lttng-overhead/blob/master/README I could improve the performance by 30% by adding the "DPDK" based plugin for get_clock() and get_cpu(), Here are the performance numbers after adding the plugin on x86 and various arm64 board that I have access to, On high-end x86, it comes around 236 cycles/~100ns @ 2.4GHz (See the last line in the log(ZERO_ARG)) On arm64, it varies from 312 cycles to 1100 cycles(based on the class of CPU). In short, Based on the "IPC capabilities", The cost would be around 100ns to 400ns for single void trace(a trace without any argument) [lttng-overhead-x86] $ sudo ./calibrate/build/app/calibrate -c 0xc0 make[1]: Entering directory '/export/lttng-overhead-x86/calibrate' make[1]: Leaving directory '/export/lttng-overhead-x86/calibrate' EAL: Detected 56 lcore(s) EAL: Detected 2 NUMA nodes EAL: Multi-process socket /var/run/dpdk/rte/mp_socket EAL: Selected IOVA mode 'PA' EAL: Probing VFIO support... EAL: PCI device 0000:01:00.0 on NUMA socket 0 EAL: probe driver: 8086:1521 net_e1000_igb EAL: PCI device 0000:01:00.1 on NUMA socket 0 EAL: probe driver: 8086:1521 net_e1000_igb CPU Timer freq is 2600.000000MHz NOP: cycles=0.194834 ns=0.074936 GET_CLOCK: cycles=47.854658 ns=18.405638 GET_CPU: cycles=30.995892 ns=11.921497 ZERO_ARG: cycles=236.945113 ns=91.132736 We will have only 16.75ns to process 59.2 mpps(40Gbps), So IMO, Lttng CTF emitter may not fit the DPDK fast path purpose due to the cost associated with generic Lttng features. One option could be to have, native CTF emitter in EAL/DPDK to emit the trace in a hugepage. I think it would be a handful of cycles if we limit the features to the requirements above: The upside of using Lttng CTF emitter: a) No need to write a new CTF trace emitter(the item (c)) The downside of Lttng CTF emitter(the item (c)) a) performance issue(See above) b) Lack of Windows OS support. It looks like, it has basic FreeBSD support. c) dpdk library dependency to lttng for trace. So, Probably it good to have native CTF emitter in DPDK and reuse all open-source trace viewer(babeltrace and TraceCompass) and format(CTF) infrastructure. I think, it would be best of both world. Any thoughts on this subject? Based on the community feedback, I can work on the patch for v20.05.