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 DD4E443D17; Thu, 21 Mar 2024 17:18:29 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 30B0C42E1B; Thu, 21 Mar 2024 17:18:26 +0100 (CET) Received: from mail-oi1-f171.google.com (mail-oi1-f171.google.com [209.85.167.171]) by mails.dpdk.org (Postfix) with ESMTP id 971E842E0E for ; Thu, 21 Mar 2024 17:18:23 +0100 (CET) Received: by mail-oi1-f171.google.com with SMTP id 5614622812f47-3c3abf3623fso501660b6e.0 for ; Thu, 21 Mar 2024 09:18:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1711037903; x=1711642703; 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=xqoQjddPJTCRki+zfyQG8f8kX1ufFvfvWENoNhZ+O1c=; b=tD/HHtUHSXsWIe/XaG/kkrrh6VplZhNnIkwXFMu6C2ab2KkuLueSgBWNikws9obFh/ DpS5XoxIprWKXUo2ip1v5HM/+RFYm09BvTqejcBAXc3BaqIzrwItfFPBAk7XTFQ2K/Yb 1XivjTVHEndCK/JNjV1d433M8tdPAeSWSWXLhO7GuVk0ykiP3XtLociiyHYcosyqWCZp 7CoeToaBRGpCRJ+KZgkzu1u6EUOH1LVgDr2A1eEr66aSlAAvaBS+f8ya8tcdHooiDck+ ZCdi2JnSsJeCDMkFqJNC39kwuVrpL+hi85TvfFFuWsWQmqBFvR7s+tAbHrpclM4pQNtJ 2JzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711037903; x=1711642703; 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=xqoQjddPJTCRki+zfyQG8f8kX1ufFvfvWENoNhZ+O1c=; b=rfLDe/QlZDWAS1TcINp2Gy2U8y8Oz0osNE2sHyd7f93GxGN7q2yt+0ct8aSWukHXuX oIPQQ++n3f12AftmYjCkwt7jy4AaYFK6xBiy91TQfw8KZyODbgmEPGivTWRbr4GMYu6H /BDR9JkaKcGmsVgxqhEet6XXK21kIpcgyk0v1Lf//H9rhglq5NCYJB71FjX+7jQxNM8K uLqA2F/bBwxrhQNHu7OqeWQ3zYQ7H/cM+WWG6U9grVSG04NxlFhve/iA9y1ogd3hplM3 7Ri8hDGmDtD5WGUQgWOp4rrPR8jg162TKE3QvKXhGR5Rffosxhg71X0lPQrLD5Bl3vhr YATw== X-Gm-Message-State: AOJu0YwwPGukSIvifgHn0a3lBsOL5yxAuXdSzCSfrMytwC2tYWFsV2gt msqi55sQi6y646H4oErniDNiXLsUDLdbrvzVQ8uvN9pNe7eFapIGqE+TC5mJUumj6sMfZqNU2Wt I X-Google-Smtp-Source: AGHT+IERZ5pFMhjOet658dkyLtJ2S5e06hV9IdubWkg0OEMhOgJMWuRpytGBGPQT0atTEvvAvByx3A== X-Received: by 2002:a05:6a21:7884:b0:1a3:52a6:4054 with SMTP id bf4-20020a056a21788400b001a352a64054mr12060pzc.0.1711037516461; Thu, 21 Mar 2024 09:11:56 -0700 (PDT) Received: from hermes.local (204-195-123-203.wavecable.com. [204.195.123.203]) by smtp.gmail.com with ESMTPSA id w62-20020a638241000000b005e485fbd455sm41815pgd.45.2024.03.21.09.11.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 09:11:56 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v10 00/10] Logging enhancements. Date: Thu, 21 Mar 2024 09:00:16 -0700 Message-ID: <20240321161146.340421-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 (for 24.07 release). This is update to earlier patch set. It adds two 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. The message going into syslog is already timestamped (by syslog) so no additional timestamp is needed. * 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. I find color helpful because 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. Note: neither of these are possible on Windows because the fopencookie() function is a GNU libc and not Posix feature. Will add a release note in next release (after this is merged). v10 - put windows getopt patch in series since otherwise windows build fails. - support multiple timestamp formats - support colorized output - fix up rte_init_alert() and rte_exit() to match format expected by the timestamp and color modes - initialize logging much earlier in startup - add documentation about logging options Stephen Hemminger (10): windows: make getopt functions have const properties log: unify logging code eal: make eal_log_level_parse common eal: initialize log earlier in startup eal: do not duplicate rte_init_alert() messages eal: change rte_exit() output to match rte_log() eal: allow user to set default log stream before init eal: add option to put timestamp on console output log: colorize log output doc: add documentation of logging options app/dumpcap/main.c | 3 + app/pdump/main.c | 3 + app/proc-info/main.c | 3 + app/test/test_eal_flags.c | 17 + doc/guides/linux_gsg/eal_args.include.rst | 54 ++- doc/guides/linux_gsg/linux_eal_parameters.rst | 27 -- doc/guides/prog_guide/log_lib.rst | 28 +- lib/eal/common/eal_common_debug.c | 11 +- lib/eal/common/eal_common_options.c | 70 +++- lib/eal/common/eal_options.h | 5 + lib/eal/freebsd/eal.c | 53 +-- lib/eal/linux/eal.c | 58 +--- lib/eal/unix/eal_unix_log.c | 0 lib/eal/windows/eal.c | 35 -- lib/eal/windows/getopt.c | 23 +- lib/eal/windows/include/getopt.h | 8 +- lib/log/log.c | 6 + lib/log/log_freebsd.c | 12 - lib/log/log_internal.h | 16 + lib/log/log_linux.c | 61 ---- lib/log/log_unix.c | 321 ++++++++++++++++++ lib/log/log_windows.c | 12 + lib/log/meson.build | 12 +- lib/log/version.map | 3 + 24 files changed, 577 insertions(+), 264 deletions(-) create mode 100644 lib/eal/unix/eal_unix_log.c delete mode 100644 lib/log/log_freebsd.c delete mode 100644 lib/log/log_linux.c create mode 100644 lib/log/log_unix.c -- 2.43.0