Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp8217158ybn; Tue, 1 Oct 2019 05:08:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqxWutCXGG3kR8MCjWuiGiXHO5iatCaUzRbdLdMLtZplQ+oFGeF9CjH8gGasHjhlHhO89KqB X-Received: by 2002:aa7:dad9:: with SMTP id x25mr25440732eds.7.1569931685403; Tue, 01 Oct 2019 05:08:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569931685; cv=none; d=google.com; s=arc-20160816; b=TKWkDGfHD5QoMZJ9+kENLJk6xUw5K6fL6Sn5ErEQ/BvGoQPrEBacnQgkoTGJ0fy9NB paOD2hZ6DSgTFtMuBZK+lgyDA0zJUQg6AwYd9N/pB5TnsVgVIwV1cimfDT1iUSxlyBRF KjUH4HOzhlle4udTtTz61UgAAF56QBDvEcV98hbjKInyv1+OzTals1jjfEmYbe/22Yly 3niAsPfusRg7K0hUBJzYDHyjMi7nXlDMgqOi4+rDxkwxD/cPbDJZs3x3bZ+IN/mLHxfe H3hl3ZZnlKj/ErqfUCC2tJdQ0HlGyDsPyzhZ5UJ6PyAVUBtpmPNcAORJdBriZct+mI3E lCsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=42E853Qvmv+ezeekQDR90DIBqfR1sARXiflSv4bctt0=; b=Gbp81/7QByjmU4m+ZWimuu6mkzlmgXrx7nBRzYSS741ukANyHOhKcS18tieMEvXajv F+mCzezfWXctkxmnkqfTUTJiEFPovS9uYmJ6TCa0/VmBslL7ziVU2wp6NSSSYtmgyoAd LDH48DnFehdodf4ZH20je9w0iEBn/2O7HwKVNdX6ACi8tlnawVse8/qbVbMUSiPPn0N0 qX9gPOLKgMqOTViwGG2/0xVssuup16Nixp2JZTKgyh0K2wYKqvkSu1YleCUUzieq1bS+ HsreuzySiZph3d3SMFploxTQ766vHQ9XAXU9bUKqYDLCj0tJ/ZxkNFulNmaIxf9RMaGq RfLg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a41si9068103eda.366.2019.10.01.05.07.40; Tue, 01 Oct 2019 05:08:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733173AbfJAME3 (ORCPT + 99 others); Tue, 1 Oct 2019 08:04:29 -0400 Received: from mx2.suse.de ([195.135.220.15]:37522 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725821AbfJAME3 (ORCPT ); Tue, 1 Oct 2019 08:04:29 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id B00D5B149; Tue, 1 Oct 2019 12:04:26 +0000 (UTC) Date: Tue, 1 Oct 2019 14:04:23 +0200 From: Petr Mladek To: Sodagudi Prasad Cc: sergey.senozhatsky@gmail.com, rostedt@goodmis.org, linux-kernel@vger.kernel.org Subject: Re: Time stamp value in printk records Message-ID: <20191001120423.ann2i2cvkojy6hcb@pathway.suse.cz> References: <7d1aee8505b91c460fee347ed4204b9a@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <7d1aee8505b91c460fee347ed4204b9a@codeaurora.org> User-Agent: NeoMutt/20170912 (1.9.0) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 2019-09-30 06:33:42, Sodagudi Prasad wrote: > Hi All, > > From Qualcomm side, we would like to check with upstream team about adding > Raw time stamp value to printk records. On Qualcomm soc, there are various > DSPs subsystems are there - for example audio, video and modem DSPs. > Adding raw timer value(along with sched_clock()) in the printk record helps > in the following use cases – > 1) To find out which subsystem crashed first - Whether application > processor crashed first or DSP subsystem? > 2) If there are any system stability issues on the DSP side, what is the > activity on the APPS processor side during that time? > > Initially during the device boot up, printk shed_clock value can be matched > with timer raw value used on the dsp subsystem, but after APPS processor > suspends several times, we don’t have way to correlate the time stamp value > on the DSP and APPS processor. All timers(both apps processor timer and dsp > timers) are derived from globally always on timer on Qualcomm soc, So > keeping global timer raw values in printk records and dsp logs help to > correlate the activity of all the processors in SoC. > > It would be great if upstream team adds common solution this problem if all > soc vendors would get benefit by adding raw timer value to printk records. There were some proposals in the past. IMHO, the most comprehensive discussion can be found at https://lore.kernel.org/lkml/alpine.DEB.2.20.1711131023170.1851@nanos/ The main requirement is: + The main timestamp must have the same semantic on all systems + User space parses the timestamp. We must not break the format and semantic. + printk() need to get the timestamp a lockless way Now, different people wanted different clocks in the past. Which brings several problems: + configuration + storing + output format so that people/tools know what they read There is a huge risk that it will get over engineered. Also there is a risk that some userspace tools might parse it and we would need to maintain compatibility forever. IMHO, the most acceptable idea was to print a line with "all" possible clocks every now and then. It can be done regularly (once a hour/day) or on event (resume). These are hints and pointers. Feel free to send patches so that we could discuss them. Best Regards, Petr