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 1C6D3A0597; Tue, 21 Apr 2020 14:59:27 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DB91F1D421; Tue, 21 Apr 2020 14:59:26 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 7CEFE1D409 for ; Tue, 21 Apr 2020 14:59:24 +0200 (CEST) IronPort-SDR: +qqFdrmDzWKH0IysW+GHy84BsWiS/5ZUAvKvBjZ+JZO5vq0frgXjPxC2uUkuhpPZHUJRPa/gfb HgVt5Dzk9jiQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Apr 2020 05:59:23 -0700 IronPort-SDR: UZACttQZJAUxYlPMc6mZc4JaXdgZr5TFcMsd2rK5eW3YFiGV4QUNPwxuzKBpsNR5jwSZya0hR0 gVAUjQuKh20w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,410,1580803200"; d="scan'208";a="279629041" Received: from silpixa00399953.ir.intel.com (HELO silpixa00399953.ger.corp.intel.com) ([10.237.222.53]) by fmsmga004.fm.intel.com with ESMTP; 21 Apr 2020 05:59:20 -0700 From: Ciara Power To: dev@dpdk.org, kevin.laatz@intel.com Cc: reshma.pattan@intel.com, jerinjacobk@gmail.com, david.marchand@redhat.com, keith.wiles@intel.com, mb@smartsharesystems.com, thomas@monjalon.net, Ciara Power Date: Tue, 21 Apr 2020 13:39:32 +0100 Message-Id: <20200421123949.38270-1-ciara.power@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200319171907.60891-1-ciara.power@intel.com> References: <20200319171907.60891-1-ciara.power@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v3 00/17] update and simplify telemetry library. 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" Note: as discussed on-list, v4 will use a non-json internal representation. v3: - Removed rte_option as it is no longer used. - General cleanup. v2: - Added JSON API, and unit tests, to simplify creation of valid json responses from libraries. - Added printing of basic info, including max output buffer size, app PID and DPDK version on connection. - Added /info command to report that basic info post-connect. This replaces the eal version command from v1. - Renamed stats to xstats in commands to allow a future generic "stats" call. - Added documentation, including updating existing howto and adding programmers guide section and API docs. - Added link status command for ethdev ports. - Fixed windows builds. This patchset extensively reworks the telemetry library adding new functionality and simplifying much of the existing code, while maintaining backward compatibility. This work is based on the previously sent RFC for a "process info" library: https://patchwork.dpdk.org/project/dpdk/list/?series=7741 However, rather than creating a new library, this patchset takes that work and merges it into the existing telemetry library, as mentioned above. The telemetry library as shipped in 19.11 is based upon the metrics library and outputs all statistics based on that as a source. However, this limits the telemetry output to only port-level statistics information, rather than allowing it to be used as a general scheme for telemetry information across all DPDK libraries. With this patchset applied, rather than the telemetry library being responsible for pulling ethdev stats and pushing them into the metrics library for retrieval later, each library e.g. ethdev, rawdev, and even the metrics library itself (for backwards compatiblity) now handle their own stats. Any library or app can register a callback function with telemetry, which will be called if requested by the client connected via the telemetry socket. The callback function in the library/app then formats its stats, or other data, into a JSON string, and returns it to telemetry to be sent to the client. To maintain backward compatibility, e.g. to allow the dpdk telemetry collectd plugin to continue to work, some of the existing telemetry code is kept, but is moved into the metrics library, and callbacks are registered with telemetry for the legacy commands that were supported previously. The new version of the library, apart from the legacy interface support for backward compatibility, does not have an external dependency on the Jansson library, allowing the library to be enabled by default. Note: In this version of the patchset, telemetry output is provided by the ethdev, rawdev and eal libraries, but this may be expanded further in later versions which are planned ahead of the merge deadline for 20.05 Bruce Richardson (8): build: add arch-specific header path to global includes telemetry: invert dependency on metrics telemetry: introduce new telemetry functionality telemetry: add utility functions for creating json app/test: add telemetry json tests ethdev: add callback support for telemetry usertools: add new telemetry python script eal: add eal telemetry callbacks Ciara Power (9): telemetry: move code to metrics for later reuse metrics: reduce code taken from telemetry rawdev: add callback support for telemetry examples/l3fwd-power: enable use of new telemetry telemetry: introduce telemetry backward compatibility telemetry: remove existing telemetry files lib: add telemetry as eal dependency eal: remove rte-option infrastructure doc: update telemetry documentation app/test/Makefile | 2 + app/test/meson.build | 4 + app/test/test_telemetry_json.c | 136 ++ config/common_base | 2 +- config/meson.build | 7 - doc/api/doxy-api-index.md | 1 + doc/guides/howto/telemetry.rst | 108 +- doc/guides/linux_gsg/eal_args.include.rst | 8 + doc/guides/linux_gsg/sys_reqs.rst | 2 - doc/guides/prog_guide/index.rst | 1 + doc/guides/prog_guide/telemetry_lib.rst | 62 + doc/guides/rel_notes/release_20_05.rst | 15 + examples/l3fwd-power/Makefile | 2 +- examples/l3fwd-power/main.c | 53 +- examples/l3fwd-power/meson.build | 2 +- lib/Makefile | 10 +- lib/librte_eal/arm/include/meson.build | 2 - lib/librte_eal/common/eal_common_options.c | 81 +- lib/librte_eal/common/eal_internal_cfg.h | 1 + lib/librte_eal/common/eal_options.h | 7 + lib/librte_eal/common/eal_private.h | 28 - lib/librte_eal/common/meson.build | 2 - lib/librte_eal/common/rte_option.c | 95 - lib/librte_eal/freebsd/Makefile | 2 +- lib/librte_eal/freebsd/eal.c | 26 +- lib/librte_eal/freebsd/meson.build | 2 +- lib/librte_eal/include/meson.build | 1 - lib/librte_eal/include/rte_option.h | 72 - lib/librte_eal/linux/Makefile | 2 +- lib/librte_eal/linux/eal.c | 26 +- lib/librte_eal/linux/meson.build | 2 +- lib/librte_eal/meson.build | 5 +- lib/librte_eal/ppc/include/meson.build | 2 - lib/librte_eal/rte_eal_version.map | 1 - lib/librte_eal/x86/include/meson.build | 2 - lib/librte_ethdev/Makefile | 2 +- lib/librte_ethdev/meson.build | 2 +- lib/librte_ethdev/rte_ethdev.c | 99 + lib/librte_metrics/Makefile | 10 + lib/librte_metrics/meson.build | 9 + lib/librte_metrics/rte_metrics.c | 6 +- lib/librte_metrics/rte_metrics.h | 5 +- lib/librte_metrics/rte_metrics_telemetry.c | 539 +++++ lib/librte_metrics/rte_metrics_telemetry.h | 65 + lib/librte_metrics/rte_metrics_version.map | 7 + lib/librte_rawdev/Makefile | 2 +- lib/librte_rawdev/meson.build | 2 + lib/librte_rawdev/rte_rawdev.c | 75 + lib/librte_telemetry/Makefile | 15 +- lib/librte_telemetry/meson.build | 15 +- lib/librte_telemetry/rte_telemetry.c | 1895 ----------------- lib/librte_telemetry/rte_telemetry.h | 78 +- lib/librte_telemetry/rte_telemetry_internal.h | 112 - lib/librte_telemetry/rte_telemetry_json.h | 206 ++ lib/librte_telemetry/rte_telemetry_legacy.h | 65 + lib/librte_telemetry/rte_telemetry_parser.c | 682 ------ lib/librte_telemetry/rte_telemetry_parser.h | 15 - .../rte_telemetry_parser_test.c | 533 ----- .../rte_telemetry_socket_tests.h | 36 - .../rte_telemetry_version.map | 5 +- lib/librte_telemetry/telemetry.c | 312 +++ lib/librte_telemetry/telemetry_legacy.c | 226 ++ lib/meson.build | 3 +- meson.build | 9 + mk/rte.app.mk | 11 +- usertools/dpdk-telemetry.py | 83 + usertools/meson.build | 2 +- 67 files changed, 2241 insertions(+), 3659 deletions(-) create mode 100644 app/test/test_telemetry_json.c create mode 100644 doc/guides/prog_guide/telemetry_lib.rst delete mode 100644 lib/librte_eal/common/rte_option.c delete mode 100644 lib/librte_eal/include/rte_option.h create mode 100644 lib/librte_metrics/rte_metrics_telemetry.c create mode 100644 lib/librte_metrics/rte_metrics_telemetry.h delete mode 100644 lib/librte_telemetry/rte_telemetry.c delete mode 100644 lib/librte_telemetry/rte_telemetry_internal.h create mode 100644 lib/librte_telemetry/rte_telemetry_json.h create mode 100644 lib/librte_telemetry/rte_telemetry_legacy.h delete mode 100644 lib/librte_telemetry/rte_telemetry_parser.c delete mode 100644 lib/librte_telemetry/rte_telemetry_parser.h delete mode 100644 lib/librte_telemetry/rte_telemetry_parser_test.c delete mode 100644 lib/librte_telemetry/rte_telemetry_socket_tests.h create mode 100644 lib/librte_telemetry/telemetry.c create mode 100644 lib/librte_telemetry/telemetry_legacy.c create mode 100755 usertools/dpdk-telemetry.py -- 2.17.1