Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1522483pxk; Thu, 10 Sep 2020 18:26:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxNEpf9AFq+Hwx5DafiWffhUVdfS8CAdwNkjB3+f0yrPKsd+uUu+LvSgYW7XHSr56u6zPIa X-Received: by 2002:a17:906:c348:: with SMTP id ci8mr12231687ejb.417.1599787604605; Thu, 10 Sep 2020 18:26:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599787604; cv=none; d=google.com; s=arc-20160816; b=ib+frsnLkIhpz7eUfGF8Y33DLzZze+EF0C3k1lYuIz+dh/UcYAUCUwbzDZoAh2P0ev hHXRUM2rx4CyfhCzExob5qEfJrHRZCAxGTzc2LxDWoRjIJbgV/2pcsmZf7uLULCRWxbq rvkdeAAy/kVTLzl9iLbdBR0yjpmjjE5Cxp1gvR9ikxWznwSmbiygmWSHGNDry7KJZA/9 koO9hJr7CxodnmlyEWUFFrPCseEydy9rFwBAkl10fcN9Cw/rKwUpI9gv80bcn6sQ1+n2 bnt4Jlj8K97pywMxGCZjZeYLujDxTREUS1Hcyn/EKmipnsH/K38vIHZiVNu540Lq4Z18 FZiw== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=M0h1+gDb9u9/7GRoBPXUiRhLCu1AqpfGRVhaREDJzvE=; b=PDghqEqzhcrnHiEKR0fyVrkBdSMKO+l+GYLhMDUW+XTbt51giKtrEzHZi0T6FBdVAJ VkP3Hwg0+bJ36p+QQ1iWANnh6nKj4KvnG311Bo9yRlIZzIbKKo+1OLjbjLKPS79S/vQV DAtkc6TNJlxDyxrP0hHopVF6A1Tbwal2ihP3Hew7fRQyZanqaYNCHK0yyJ4OwmVoI7LM kyMCHTyLG2cQsi9rc4eHBdWnHQ/D3jCkPb4U6zvFdOkemjualZSAYm3DJxawWpyUUsih xp9gfHQIKDI1w3XxYUq3/1FBZiMn5KK3Rd7Wvgy4rt0FOZtoCrF4yNb6FTFiPjiRx7A4 enBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b="FYWuL/bx"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id co28si259086edb.562.2020.09.10.18.26.19; Thu, 10 Sep 2020 18:26:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b="FYWuL/bx"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725826AbgIKBZZ (ORCPT + 99 others); Thu, 10 Sep 2020 21:25:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725280AbgIKBZY (ORCPT ); Thu, 10 Sep 2020 21:25:24 -0400 Received: from mail-io1-xd43.google.com (mail-io1-xd43.google.com [IPv6:2607:f8b0:4864:20::d43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2F95C061573 for ; Thu, 10 Sep 2020 18:25:23 -0700 (PDT) Received: by mail-io1-xd43.google.com with SMTP id y13so9363333iow.4 for ; Thu, 10 Sep 2020 18:25:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=M0h1+gDb9u9/7GRoBPXUiRhLCu1AqpfGRVhaREDJzvE=; b=FYWuL/bxPThnma7R4WEwXVU5CSZzAeRcxLZORbaTc26AM6KvTaF8MAXr5Lmxe87hBY gcrjugE1QCebBJ06YfmO8yJmNYh0LXgAqZZJE/vT80s2Q57ll0qJEqUNbqARtGmjgZIY Avf8GXOLwkcXet85hq4rWi62LJb1hUGstV5u4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=M0h1+gDb9u9/7GRoBPXUiRhLCu1AqpfGRVhaREDJzvE=; b=My3hl/9HkEW1WLLh8UB+Us7huATOhQKLZmFqgvauL4QKAUpnep2x+vfxNr3K0kjBfl eO7KXh3GfTpSrhLtVEt49ZHiMf30KjLeY5f4r6yn8CmHZbRpoNq2kFblnnk4rGZaQNM+ ICT+Jxv7XUbTy7M0ZYz7VnjM8FKFeygID5UC6RkJcO+YU+ZFPFFr8SMSEQzyxdzUu3Cp I9yKUmmoyjuFqXze9kUO/eoLKkd487HjT/gXfmV/7/lEM4ByNO0VWPHCihvO/gnf04S9 8OOA5Vbk+BNEMSSOeHs4toKC63v6g3gWyus0UzEW1uuAr/ucII4lOkYTRWmgllh35Ofl GrMg== X-Gm-Message-State: AOAM530DRS3v27AKo31R6c7tQEZ5oKvvlfaN1NaZj/9mBqJQ8lGVy9GZ 9W6QOOKjpQFvkmu5R+W4rNuzP+J9nSqVMbIEsHtyug== X-Received: by 2002:a02:a0c2:: with SMTP id i2mr10993351jah.92.1599787522983; Thu, 10 Sep 2020 18:25:22 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Joel Fernandes Date: Thu, 10 Sep 2020 21:25:11 -0400 Message-ID: Subject: Re: [RFC PATCH 0/7] Trace events to pstore To: Rob Herring Cc: Nachammai Karuppiah , Steven Rostedt , Ingo Molnar , Frank Rowand , Kees Cook , Anton Vorontsov , Colin Cross , Tony Luck , LKML , Sai Prakash Ranjan , Brian Norris Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Rob, (Back from holidays, digging through the email pile). Reply below: On Thu, Sep 3, 2020 at 2:09 PM Rob Herring wrote: > > On Wed, Sep 2, 2020 at 3:47 PM Joel Fernandes wr= ote: > > > > On Wed, Sep 2, 2020 at 4:01 PM Nachammai Karuppiah > > wrote: > > > > > > Hi, > > > > > > This patch series adds support to store trace events in pstore. > > > > > > Storing trace entries in persistent RAM would help in understanding w= hat > > > happened just before the system went down. The trace events that led = to the > > > crash can be retrieved from the pstore after a warm reboot. This will= help > > > debug what happened before machine=E2=80=99s last breath. This has to= be done in a > > > scalable way so that tracing a live system does not impact the perfor= mance > > > of the system. > > > > Just to add, Nachammai was my intern in the recent outreachy program > > and we designed together a way for trace events to be written to > > pstore backed memory directory instead of regular memory. The basic > > idea is to allocate frace's ring buffer on pstore memory and have it > > right there. Then recover it on reboot. Nachammai wrote the code with > > some guidance :) . I talked to Steve as well in the past about the > > basic of idea of this. Steve is on vacation this week though. > > ramoops is already the RAM backend for pstore and ramoops already has > an ftrace region defined. What am I missing? ramoops is too slow for tracing. Honestly, the ftrace functionality in ramoops should be removed in favor of Nachammai's patches (she did it for events but function tracing could be trivially added). No one uses the current ftrace in pstore because it is darned slow. ramoops sits in between the writing of the ftrace record and the memory being written to adding more overhead in the process, while also writing ftrace records in a non-ftrace format. So ramoop's API and infrastructure fundamentally does not meet the requirements of high speed persistent tracing. The idea of this work is to keep the trace events enabled for a long period time (possibly even in production) and low overhead until the problem like machine crashing happens. > From a DT standpoint, we already have a reserved persistent RAM > binding too. There's already too much kernel specifics on how it is > used, we don't need more of that in DT. We're not going to add another > separate region (actually, you can have as many regions defined as you > want. They will just all be 'ramoops' compatible). I agree with the sentiment here on DT. Maybe the DT can be generalized to provide a ram region to which either ramoops or ramtrace can attach. - Joel