From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-f43.google.com (mail-pg0-f43.google.com [74.125.83.43]) by dpdk.org (Postfix) with ESMTP id 89975160 for ; Tue, 19 Dec 2017 16:44:30 +0100 (CET) Received: by mail-pg0-f43.google.com with SMTP id k15so10677512pgr.7 for ; Tue, 19 Dec 2017 07:44:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=u7sgGx4DjmwhBKxWGZPdZfXSaLtNAZ8BI4cOuWIuWbI=; b=YCumueJc5gwKBPRisL9DaBnxLWwn+zLXZJD9fKEiXbO8OIWlBVox+4EmoCKFa0C7KN vzAmWjyAKOX70dNgAQMnN/laJjR1OaBD8AA11bM5wQLTvsDzv22p83FTwWd38WOYm3zg Gg/FG7NZ8kHNdvroXPJVF1LLMxGYHt2OX12kQG9YMlcSw+19RQp38RcIsZ9zmDp5ZSue L8FiF2nXjD2lffvnCeYgwCIKxedymNjrEiO3ipx+BxR4SlS9oyGHrRfp8VpXHIb3vwIg 2WH9f+WovGdMQJhHSYWtGF2UnRy2vyOODp4ZMwwY3ekoOFgbJ6OrPiri8IvA2CYLGX1l BAIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=u7sgGx4DjmwhBKxWGZPdZfXSaLtNAZ8BI4cOuWIuWbI=; b=QOhJTIVsiQGLr0x3EwxdZv/aaCeTir8yIA5qlv/Wt9/ITlpCbHo4UCa9oIMPu/vKRC OUQ/MTshnnZZ7ZcyvqqgjTpwmnOx5+V001B2e435EeypI92BTA81r4RaNX8Ucfl1R6Zk h2dnzCeOT0uWjH4SSoxumKSwzl7jDfSLsbqqwEiDB03MQBUnfxR69htg37a0KcqZgu4w iVKftWS4kM4AI8saCBWesVZbEfkXjUWR8wCqzLnkPer0DRknopILSGsOpaMXy7NhfpeU snJs6w9cUJepK58QkHgWIjQy7XpM05DGrf1GSn9POFBGVR8sNHTHcyYU7xueauhPQTKh arQg== X-Gm-Message-State: AKGB3mLgW1gz4+8xQkiWcBfjMhy9rufMXVhqsenXNY467s212QUTpjca lLG2sM4Dxvt0tlJ56Yq49fCn5A== X-Google-Smtp-Source: ACJfBoumJNCdjtlDSSWC8kvYLmd5Uo/Xf4BeZTu5WktuDTUACJLF19ECX+n325EoKFpElDVblqbrRw== X-Received: by 10.98.41.197 with SMTP id p188mr3683991pfp.9.1513698269721; Tue, 19 Dec 2017 07:44:29 -0800 (PST) Received: from xeon-e3 (204-195-18-133.wavecable.com. [204.195.18.133]) by smtp.gmail.com with ESMTPSA id k130sm32400047pfc.100.2017.12.19.07.44.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Dec 2017 07:44:29 -0800 (PST) Date: Tue, 19 Dec 2017 07:44:27 -0800 From: Stephen Hemminger To: "Wiles, Keith" Cc: DPDK Message-ID: <20171219074427.2f6f4dfe@xeon-e3> In-Reply-To: <96F900E1-45E4-4448-A876-5EC2B92E7E8D@intel.com> References: <96F900E1-45E4-4448-A876-5EC2B92E7E8D@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [dpdk-dev] Logging format and time stamping 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: , X-List-Received-Date: Tue, 19 Dec 2017 15:44:31 -0000 On Tue, 19 Dec 2017 14:12:27 +0000 "Wiles, Keith" wrote: > Hi all, >=20 > One other area with logging is we do not time stamp our logs to the scree= n, which I feel is needed in some cases. The bigger area is figuring out wh= ere the log message came from and greping the code is a bit hard in some ca= ses. >=20 > I would like to see more information in the log output with file and line= number of the log message with the time stamp. e.g. >=20 > [timestamp] pid function_name(filename:line) logid: log message >=20 >=20 > [ timestamp ] pid Function/file/line number Lid: Log message= =20 > [ 14.039999] 49203 pkt_data_to_mbuf(pkt_mbufs.h:85) FNET: Failed appe= nd to mbuf too much data. >=20 > - The time stamp is from gettimeofday seconds.usecs formatted. Using a re= lative time from application start. > - The pid is the process ID or logical core id in fixed %5d or some fixed= width. > - Function/file/line number __func__(basename(__FILE__):__LINE__) using a= fixed width like %30s does not work in all cases but most. > - The lid is the LOG ID used(PMD, EAL, =E2=80=A6) and then the original l= og message. >=20 > The timestamp helps determine when the message was created, but could be = turned off for normal use. The pid would be nice to know which thread or lc= ore created the message. The bigger one is the function/file/line is the on= e a would like to see most. Making some of the fields fixed length helps al= ign the messages. >=20 > What are your thoughts here? >=20 > Regards, > Keith >=20 Syslog is where most real applications send their logging, and it already d= oes timestamping.