Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp744679imm; Sat, 22 Sep 2018 09:37:44 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYwSHp1MADmPIlcSr7pS7f9ZclJG+d0AeaKEBYNR6I+GF9LevBeAJvjMFZZkl1WOOQDyLPB X-Received: by 2002:a62:23cd:: with SMTP id q74-v6mr1178606pfj.151.1537634264553; Sat, 22 Sep 2018 09:37:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537634264; cv=none; d=google.com; s=arc-20160816; b=rixADw8opvmv4Gs7iC3PHrPCPBuuugfI3sgoYLdpqeQ4ImAJINgzC3I8LRRZ+1hV6o M+1JW3GahHn2oRTLGLZar1q8aKFQ+ZEwdzg7m4oz8ZyUWs6ox0qgyl3TQHVHMFzoP0sW 8KbXUIfPNTCq8PRCnXsMqvGJThhpeO6NvTCqmLRguF+eoDMfz/n6fcD+cMeI7Cj49M8N ErXbRXv3VslA8+d+TOZ6NAg6pAl3LcKiZMzomu2UKxhlDP/sVPj5wpValpIqblZwBjIK Zu50Vapcy02CWefjbF3f0TpI+qDwSVkygrsG54onO7UhXsvRSYuTcSE9wwq7lm6c94A+ u83A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dmarc-filter :dkim-signature:dkim-signature; bh=z6cWlDnQZE+BITe0/83l3G/2zIcoktdv8nmPMob8WPU=; b=hBXHZfRtEk7ney97vRMHg1Kf3pJLozrE/MAM/dfyQGu9OMy+P1FBYc+5vR3mDBxx3p DMVl6U9naer9M0oSSphFzJFdf4+pkCqJ1YFCGDPgIcL9Q5FUX1ftxWNOOVWbj7bX//CW vfm24GbdeJlpUEPwNMJbxBfwyhREyaKKW1obddcaYaloLa7bCgJ9xg7DrMXC8l3uboxO bhn/tIQdkjgbszS8BjStX10B3HY/JpQgA4W7+M5efA1BgdkItEMg3TUmCr29hGuBIADO QfY7RKYuDzJvuL6biK1ISv7NdzKs2agZBs53OMkBOdIx9QASs2Gh/rwybhQDPoGE5XgO 8c+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=QcIhpgiR; dkim=pass header.i=@codeaurora.org header.s=default header.b=g0KkklPC; 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 o10-v6si1186761pgf.680.2018.09.22.09.37.26; Sat, 22 Sep 2018 09:37:44 -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; dkim=pass header.i=@codeaurora.org header.s=default header.b=QcIhpgiR; dkim=pass header.i=@codeaurora.org header.s=default header.b=g0KkklPC; 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 S1728551AbeIVWbc (ORCPT + 99 others); Sat, 22 Sep 2018 18:31:32 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:39974 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727993AbeIVWbc (ORCPT ); Sat, 22 Sep 2018 18:31:32 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id CA89F60E40; Sat, 22 Sep 2018 16:37:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1537634241; bh=zT/NbF/QSNZxCN2Yx3mpwRGqaFPsmMELlfVQoUUMaN0=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=QcIhpgiRObHzOg2MWh6RzX+R59IMlWsQVynEJ4teOwPj8+p6wnaSUgyXEUANeBpoy 4epGetb0jWD3Z8f0zKtLeDpygTSHRR1JS7jZPhljmxiy5O0708cOeenR7fbpNXyWS7 NunQ54MQW2AFDLQqW1C4lbQiQc4FgBFoD5m7MecU= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from [192.168.43.47] (unknown [223.237.247.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: saiprakash.ranjan@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 5FF3C60D0B; Sat, 22 Sep 2018 16:37:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1537634240; bh=zT/NbF/QSNZxCN2Yx3mpwRGqaFPsmMELlfVQoUUMaN0=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=g0KkklPCT8yA/qql/1thP7soA362xV+VOdYXwIJspSRclunsXogZovj1sySxgFQz/ vJ0dsVsTt894SIu8BPmp4XmQ5RBOCPrcLqDPr5uD//uzHegYv00/YkL036esRFlsyh p/xywuVD6HLpGtWNyjXxOn328G9knkoZFNJRMvGg= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 5FF3C60D0B Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=saiprakash.ranjan@codeaurora.org Subject: Re: [PATCH 2/6] pstore: Add event tracing support To: Joel Fernandes Cc: Steven Rostedt , Ingo Molnar , Laura Abbott , Kees Cook , Anton Vorontsov , Rob Herring , devicetree@vger.kernel.org, Colin Cross , Jason Baron , Tony Luck , Arnd Bergmann , Catalin Marinas , Will Deacon , Masami Hiramatsu , Joe Perches , Jim Cromie , Rajendra Nayak , Vivek Gautam , Sibi Sankar , linux-arm-kernel@lists.infradead.org, LKML , linux-arm-msm@vger.kernel.org, Greg Kroah-Hartman , Ingo Molnar , Tom Zanussi , Prasad Sodagudi , tsoni@codeaurora.org, Bryan Huntsman , Tingwei Zhang , kernel-team References: From: Sai Prakash Ranjan Message-ID: Date: Sat, 22 Sep 2018 22:07:00 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/22/2018 2:35 PM, Joel Fernandes wrote: > On Sat, Sep 8, 2018 at 4:28 PM Sai Prakash Ranjan > wrote: >> > Could you just split the pstore space into a per-cpu event buffer like > we are doing for ftrace-on-pstore? Then you don't need to lock. I fear > the lock contention will be apparent. The pstore code already has > plumbing to split the store buffer per CPU. > Hi Joel, Thanks a lot for reviewing. I just looked at per-cpu buffer for ftrace and itseems the pstore percpu records will need to be merged into one record if we add this support for events. Merging of ftrace logs is based on timestamp, but for events we do not have timestamp field (for this specific reason I have added timestamp field for IO event tracing so that atleast we can know the cpu number in pstore output). For example, the sched event pstore output below has no timestamp field, so how do we merge per-cpu logs? # tail /sys/fs/pstore/event-ramoops-0 sched_waking: comm=rcu_sched pid=11 prio=120 target_cpu=002 sched_wakeup: comm=rcu_sched pid=11 prio=120 target_cpu=002 Also Pstore ftrace log format is fixed i.e.,(CPU:%d ts:%llu %08lx %08lx %pf <- %pF\n"), but different events will have different formats and we will not be able to add timestamp field like how pstore ftrace does using pstore_ftrace_write_timestamp() and pstore_ftrace_read_timestamp(). Sorry if I am confusing you, I can explain better I guess. > Also I think this spinlock can be moved further down. > OK. Something like this would suffice? {{{ spin_lock_irqsave(&psinfo->buf_lock, flags); record.buf = (char *)(seq->buffer); record.size = seq->len; psinfo->write(&record); spin_unlock_irqrestore(&psinfo->buf_lock, flags); }}} >> + >> + trace_seq_init(&iter->seq); >> + iter->ent = fbuffer->entry; >> + event_call->event.funcs->trace(iter, 0, event); >> + trace_seq_putc(&iter->seq, 0); > > Would it be possible to store the binary trace record in the pstore > buffer instead of outputting text? I suspect that will both be faster > and less space. > I will try this and come back. Thanks, Sai -- QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation