From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752168AbeERW6W (ORCPT ); Fri, 18 May 2018 18:58:22 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:36500 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751878AbeERW6S (ORCPT ); Fri, 18 May 2018 18:58:18 -0400 X-Google-Smtp-Source: AB8JxZqn6gJ2+KovPj36BD/aWeHmuzolmorGq4uycRzaSiXb7mWc7b1lr6aaVQGzHy3kwFRe0nNiUQ== Date: Fri, 18 May 2018 15:58:17 -0700 From: Joel Fernandes To: Andy Shevchenko Cc: Joel Fernandes , Linux Kernel Mailing List , Steven Rostedt , Peter Zilstra , Ingo Molnar , Mathieu Desnoyers , Tom Zanussi , Namhyung Kim , Thomas Glexiner , Boqun Feng , Paul McKenney , Masami Hiramatsu , Todd Kjos , Erick Reyes , Julia Cartwright , kernel-team@android.com Subject: Re: [PATCH 1/2] lib: Add module to simulate atomic sections for testing {preempt,irqs}off tracers Message-ID: <20180518225817.GA134184@joelaf.mtv.corp.google.com> References: <20180518015902.131427-1-joelaf@google.com> <20180518015902.131427-2-joelaf@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, May 19, 2018 at 12:09:46AM +0300, Andy Shevchenko wrote: > On Fri, May 18, 2018 at 4:59 AM, Joel Fernandes wrote: > > From: "Joel Fernandes (Google)" > > > > In this patch we introduce a test module for simulating a long atomic > > section in the kernel which the preemptoff or irqsoff tracers can > > detect. This module is to be used only for test purposes and is default > > disabled. > > > > Following is the expected output (only briefly shown) that can be parsed > > to verify that the tracers are working correctly. We will use this from > > the kselftests in future patches. > > > +config TEST_ATOMIC_SECTIONS > > + tristate "Simulate atomic sections for tracers to detect" > > > + default n > > n _is_ default default. I would rather be explicit, several other TEST configs also mention it. Is it a strong desire to drop off default n? > > +/* > > SPDX? Ok, will add. > > > + */ > > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > Perhaps keep in order? Sure. > > + > > +static int atomic_time = 100; > > +static char atomic_mode[10] = "irq"; > > + > > +module_param_named(atomic_time, atomic_time, int, S_IRUGO); > > +module_param_string(atomic_mode, atomic_mode, 10, S_IRUGO); > > +MODULE_PARM_DESC(atomic_time, "Period in microseconds (100 uS default)"); > > +MODULE_PARM_DESC(atomic_mode, "Mode of the test such as preempt or irq (default irq)"); > > > + > > + > > Extra blank line. Fixed > > +static int __init atomic_sect_init(void) > > +{ > > + char task_name[50]; > > + struct task_struct *test_task; > > + > > > + sprintf(task_name, "%s dis test", atomic_mode); > > Just to be protective from dumb user. > > snprintf(); > Done. > > + > > + test_task = kthread_run((void*)atomic_sect_run, NULL, task_name); > > + if (IS_ERR(test_task)) { > > > + return -1; > > return PTR_ERR() ? Sure, will do. Thanks for the review! - Joel