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 DA2A243D85; Sat, 30 Mar 2024 17:44:46 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3D631402B1; Sat, 30 Mar 2024 17:44:46 +0100 (CET) Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) by mails.dpdk.org (Postfix) with ESMTP id B668A4021D for ; Sat, 30 Mar 2024 17:44:44 +0100 (CET) Received: by mail-pf1-f172.google.com with SMTP id d2e1a72fcca58-6e6ee9e3cffso1943522b3a.1 for ; Sat, 30 Mar 2024 09:44:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1711817083; x=1712421883; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2uMS+zoQaV+CTnny63jxah5D3dua4Q5vg/fE0IA7OUo=; b=FMcZ/OIKDL7Q7GHmIc+Nq9b8/NJTXvXRXWfiCWudNyr90THca1d4H6jXG6Lr1LN9X+ KqFXt5EItl5rYv65fR8X2NL9UilLkIePgCiaWh5VihW61ZAF4KwY8SXA0aX0AiHbJAgp HqCRtWMz1o3l3QPQqEb/mF+OZEroGfKforOMmSAi3+qYIGcxsHpJRMDKV4BdoFiAqrPG U9np/670W18z7hDqjc7AqQ5IWzh5jXJYXU7c/1tVm625drpZW8olu2MPH3h8TOREUvpq UG+7lyao4JyUrtCZf3cqJbtes9AkmtsX1f8KPbmAHnT7Vs5/kBZtIi6Be7Lw7CDq94T7 ONqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711817083; x=1712421883; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2uMS+zoQaV+CTnny63jxah5D3dua4Q5vg/fE0IA7OUo=; b=c/yz0fKepP/4yklWyPkuNSFvvz2qOfOxesDeC/qsG0uL1LUkfIi27Lt41OwkVULneI odq+U8QtqlQrEVgIiQL47acO8AJ2LWinwG+XE+ha8hYL9p+Que99aFbix3d/ywfdsRX2 9vOMXoIhVGp2siZLKt6GNzU+a3U0dzZ/x3Q4sr8h5NbYFZ69lDCZQ6uYIGHFytiU9ClF g2KXUv4DSvrHTCtiMxoozcryimEHmNX8Mm27LE890P4ckxC1RQld5420s9wU40JqtIrx TKhotZxcJqUjfFl6qqytT+bCeUv4c0K7crFm+iGbP9r7qm8R108cYuYqtj+fKpJyU3PU BDYQ== X-Gm-Message-State: AOJu0Yw+v0BHpfcdOLRkJ1Pxqv6N/htxP5dBitm6SCEILoaKFuuOwf09 aKDsxRBVxCvf9kJLWjThorUJJCbD8VLCcloN7U43k+cDyafc93i2AJpbXFRmVgGarThLdtCVThg d X-Google-Smtp-Source: AGHT+IHJIvK2/3HcmbN58bu6A8nMUymufK9OoHF1OB+p1/YcEcaO/j0I2n3zMre96X/DjwcFO/UzZQ== X-Received: by 2002:a05:6a21:6d94:b0:1a1:6cf3:265b with SMTP id wl20-20020a056a216d9400b001a16cf3265bmr8010111pzb.18.1711817083569; Sat, 30 Mar 2024 09:44:43 -0700 (PDT) Received: from hermes.local (204-195-123-203.wavecable.com. [204.195.123.203]) by smtp.gmail.com with ESMTPSA id by1-20020a056a02058100b005dc26144d96sm4192417pgb.75.2024.03.30.09.44.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Mar 2024 09:44:43 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v20 00/14] Logging unification and improvements Date: Sat, 30 Mar 2024 09:42:11 -0700 Message-ID: <20240330164433.50144-1-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20200814173441.23086-1-stephen@networkplumber.org> References: <20200814173441.23086-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Improvements and unification of logging library. This version works on all platforms: Linux, Windows and FreeBSD. This is update to rework patch set. It adds several new features to the console log output. * Putting a timestamp on console output which is useful for analyzing performance of startup codes. Timestamp is optional and must be enabled on command line. * Displaying console output with colors. It uses the standard conventions used by many other Linux commands for colorized display. The default is to enable color if the console output is going to a terminal. But it can be always on or disabled by command line flag. This default was chosen based on what dmesg(1) command does. Color is used by many tools (vi, iproute2, git) because it is helpful; DPDK drivers and libraries print lots of not very useful messages. And having error messages highlighted in bold face helps. This might also get users to pay more attention to error messages. Many bug reports have earlier messages that are lost because there are so many info messages. * Add support for automatic detection of systemd journal protocol. If running as systemd service will get enhanced logging. * Use of syslog is optional and the meaning of the --syslog flag has changed. The default is *not* to use syslog. Add myself as maintainer for log because by now have added more than previous authors. v20 - avoid use vasprintf if possible, because it requires extra patch for Windows, and increases risk of missed message if malloc pool is corrupted. - fix build on FreeBSD. Stephen Hemminger (14): maintainers: add for log library windows: make getopt functions have const properties windows: add os shim for localtime_r eal: make eal_log_level_parse common eal: do not duplicate rte_init_alert() messages eal: change rte_exit() output to match rte_log() log: move handling of syslog facility out of eal eal: initialize log before everything else log: drop syslog support, and make code common log: add hook for printing log messages log: add timestamp option log: add optional support of syslog log: add support for systemd journal log: colorize log output MAINTAINERS | 1 + app/test/test_eal_flags.c | 64 +++++- doc/guides/linux_gsg/linux_eal_parameters.rst | 27 --- doc/guides/prog_guide/log_lib.rst | 71 ++++++ lib/eal/common/eal_common_debug.c | 11 +- lib/eal/common/eal_common_options.c | 137 +++++++----- lib/eal/common/eal_options.h | 7 + lib/eal/freebsd/eal.c | 64 ++---- lib/eal/linux/eal.c | 68 ++---- lib/eal/windows/eal.c | 49 +--- lib/eal/windows/getopt.c | 23 +- lib/eal/windows/include/getopt.h | 8 +- lib/eal/windows/include/rte_os_shim.h | 10 + lib/log/log.c | 80 ++++--- lib/log/log_color.c | 148 ++++++++++++ lib/log/log_freebsd.c | 12 - lib/log/log_internal.h | 28 ++- lib/log/log_journal.c | 200 +++++++++++++++++ lib/log/log_linux.c | 61 ----- lib/log/log_private.h | 34 +++ lib/log/log_stubs.c | 37 +++ lib/log/log_syslog.c | 88 ++++++++ lib/log/log_timestamp.c | 210 ++++++++++++++++++ lib/log/log_windows.c | 18 -- lib/log/meson.build | 14 +- lib/log/version.map | 5 +- 26 files changed, 1097 insertions(+), 378 deletions(-) create mode 100644 lib/log/log_color.c delete mode 100644 lib/log/log_freebsd.c create mode 100644 lib/log/log_journal.c delete mode 100644 lib/log/log_linux.c create mode 100644 lib/log/log_private.h create mode 100644 lib/log/log_stubs.c create mode 100644 lib/log/log_syslog.c create mode 100644 lib/log/log_timestamp.c delete mode 100644 lib/log/log_windows.c -- 2.43.0