Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp5059129imm; Fri, 18 May 2018 15:59:10 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpofySD2tx0yAZ+LuBLtAZ/B3dDOHsQeyGFtmfg2s0Apba+6HOkQEW+La5DPZQKkv3gbzc7 X-Received: by 2002:a62:f80c:: with SMTP id d12-v6mr11216224pfh.159.1526684350784; Fri, 18 May 2018 15:59:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526684350; cv=none; d=google.com; s=arc-20160816; b=nwegqNE9HQQkJP3pgT2vbOvDVuPv6p0/C7u0j/zLyA4K6dYqg5v+qE3Xbsc3hc1xxg Eyi87hodISe1czvGmBszlepCjRixwEhnYyztsPzP6wtt+R3WDD0pL1kmuVGlMYot8UVv WZVCj+tfjt34ZP4WLqNmEwnlRaowYKdN8V5o7k6UNgLd8sQ3Nb0fzpjVFmMXwbiC/mcf RZPWt/UsTbtltPvoiCLYZZ+awur9N/THIzOPKpjt7lXSXiOkfhp0c8Gy5GxMNYNnudmb UDJTkDSZa4BBWKEfzpZfs8dKHTtCDoczsuo6wTdGLxM9vLP8fgKzWhsPBvNVAItUGdh/ N8qQ== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=eLmC3C1tS1yuj8dhKzKeHJQfp4ViPCLgBuWjLfm7hHg=; b=NKNr6BghgEDsiNP0fUdKBR3uuzxM1QdDUUcLBvgnl2Vi82G0XEFbBBtaEIFZ5j+1WH KnBQhHo+idr2KIYCaqQzQ8GZtGZPHSALl3j6j4Mw/PctBmz5o19LRuB+7Y7KD/kZnplV nyNVk7nj96joefyP3t2aEJsix7iCiRV1uOYpJu0Z/1rj5W3wEXdI0TbvCNPWNwdXpWIe Ff7/KezKaHu4rzXWxCCrTvemIJg7ApeopcS7wlYPohZCKBpPJ2+JqXiSqzEr0An26lE4 2CZYWIK3TboXin5Ag5B95k74rWqyj5jJJEuII40tgVDEiXF56C2pw1LqPq1DxFMGJPzG curQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=gvTppLW9; 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 c10-v6si6941938pge.596.2018.05.18.15.58.55; Fri, 18 May 2018 15:59:10 -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=@joelfernandes.org header.s=google header.b=gvTppLW9; 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 S1752128AbeERW6W (ORCPT + 99 others); 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 Received: by mail-pf0-f196.google.com with SMTP id w129-v6so4407640pfd.3 for ; Fri, 18 May 2018 15:58:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=eLmC3C1tS1yuj8dhKzKeHJQfp4ViPCLgBuWjLfm7hHg=; b=gvTppLW9OToAjYVZ9DY9XGNSriQ9LKTkKv36iDmxmsf2b7nud+kscH368DTVB47KYs 0Q+z4AML9OM0KNx2vXoxowzJRbQoMrRyKzr26axPGdVMk0jCzkrpaLHD+i8/T6T3HwXe Mhwaq6I0I7fYynGuaJUBZZhY1T0lfnTgDSncI= 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:references :mime-version:content-disposition:in-reply-to:user-agent; bh=eLmC3C1tS1yuj8dhKzKeHJQfp4ViPCLgBuWjLfm7hHg=; b=aE4yQkdCgOgoIGoGTDCAHxTLzxVM+v2edr6o7HvrggxSMZNfq/PEkGpBAjdBLD2Mrj aALdC1Sx/GE5qgRLFJxeYxt7/cMPi5r++EcHC/jZETyrBM2hvBtQ6eADnlfuTSLaT3Z6 vwdQeImhpsKkH17mQLgAAbEs/8Gz1r5L7SMbLbkKLJLyhghoIIPSTZcUYsCxVunzxk5z Iq6+zXE+THfmCLv9Kp+LCBv0JPtupx0Y2iXFPcG1oV8VtSAJFOkuaDXVHM75mUqfU3CQ fHPQbLD40d1IjfRYTOUMFIrRgzKMYKKL4bQOP7pXSOvJeS++cOSvOvRo8viMuAROHlnT wLoA== X-Gm-Message-State: ALKqPwfjdq2GW6fOS9HNvmHRQFKpMUzzbMRWBzl//toofJRsWgP3h5xd FYcbPEpMzd+x1WWaZlWaQhCYKw== X-Received: by 2002:a62:4c53:: with SMTP id z80-v6mr11246178pfa.181.1526684298391; Fri, 18 May 2018 15:58:18 -0700 (PDT) Received: from localhost ([2620:0:1000:1600:3122:ea9c:d178:eb]) by smtp.gmail.com with ESMTPSA id f2-v6sm6851671pgp.28.2018.05.18.15.58.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 18 May 2018 15:58:17 -0700 (PDT) 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 Precedence: bulk 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