Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2580416ybl; Thu, 29 Aug 2019 10:02:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqwqy1owyYW+JhO2D0S4NCgKfUYC3brfnl6OvIEHV8QYabPfu5xsVhgipcmS2QzFC9CHsFL9 X-Received: by 2002:a17:902:b905:: with SMTP id bf5mr10306431plb.342.1567098175906; Thu, 29 Aug 2019 10:02:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567098175; cv=none; d=google.com; s=arc-20160816; b=Z8fVZIWIS4kw4B5o2yCaMf2odj2kx5Ll9jreXi+qvb7Bwh/yAUlIxMG0XDOdlTcnaG BwfjrJrvyQZaUZSKOjEveHYeRLaWuvOsj4XnnrRTgeQxl6E8yi2VqO9lFhd5iilcXlNe xvlgsvXU6H6TuhV3CUzhXvio1ECPc+dYXu4sk8rboGeW4AgsA/F+70O73/fFLrMEwgdp pVb9Cfd50Gr4USVyKQ3NFZnIZ+otGfknFHSoEuCfT7id0a2QZV8QPvMEDDLztY0rEoAC jkJBWfbSaCbCoPjqCE34U5xQdqWacZDeYHP1jFT+fhQ4BQ8NwQpMQ2nlZS0+eoFu+xvN mH/Q== 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:dkim-signature; bh=KwgIHoSxnHwNZuiHl80el70hsTY1B4119KS5ZfhbCRg=; b=OPyBRc2Q2vpW7TgB5jc0kNsiWtPdTQbCc5scbU+mbcLuhOaOt4lQUs3cuCkcnMRtpi fQwNM1OlARPPUOHusaAV1RRVuibQyfUqKQckC1/05QpE4gRG/t0QGndDA9cziEIOBUT7 A9SUIM6ShEBobglSVy/kXL8LMLACXAo7glWlN+coY4Gb8u7ptQabkcTSQSa2KE79LoQK xA4d/7f/I4yk4aOlCTpSkyIDndEk60FU7SMsRfOtaBqDUuWExscwbz2paUW7LIQcKo8S +lWyCpf2jcB4ai4K5fjLJ7L3use47rwnX0ZftANuuZwLHSThBU5IJMa3zjiIvVhcldZg KVPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=m8iAap6K; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x14si1442502plm.44.2019.08.29.10.02.39; Thu, 29 Aug 2019 10:02:55 -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=@kernel.org header.s=default header.b=m8iAap6K; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727662AbfH2RB1 (ORCPT + 99 others); Thu, 29 Aug 2019 13:01:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:56258 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726739AbfH2RB1 (ORCPT ); Thu, 29 Aug 2019 13:01:27 -0400 Received: from [192.168.1.112] (c-24-9-64-241.hsd1.co.comcast.net [24.9.64.241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2B9FF21726; Thu, 29 Aug 2019 17:01:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567098084; bh=wBHheJcf0m1hNSCx9WaNoXmRMBlMJkFkSTAD62zxQXc=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=m8iAap6KIvI0VP/V3DIBBy43SPrKlEiKYwcg/DCgjayaEgWAFYCCoU8mgmDKsGRpO UXh7/TW4n79p1MN4UVopT+8X09zzYmgf2kjBFwav1qBIQuSf080T50SJnmAtH+H0Pw gWHHOWx23iKv4a3Xh1lbqdYF32NPDNgRg9FFRox4= Subject: Re: [PATCH v2] kunit: fix failure to build without printk To: Sergey Senozhatsky , Brendan Higgins , Joe Perches Cc: kunit-dev@googlegroups.com, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, frowand.list@gmail.com, sboyd@kernel.org, pmladek@suse.com, sergey.senozhatsky@gmail.com, rostedt@goodmis.org, Randy Dunlap , Stephen Rothwell , shuah References: <20190828093143.163302-1-brendanhiggins@google.com> <20190828094929.GA14038@jagdpanzerIV> From: shuah Message-ID: <8b2d63bf-56cd-e8f5-e8ee-2891c2c1be8f@kernel.org> Date: Thu, 29 Aug 2019 11:01:08 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190828094929.GA14038@jagdpanzerIV> 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 8/28/19 3:49 AM, Sergey Senozhatsky wrote: > On (08/28/19 02:31), Brendan Higgins wrote: > [..] >> Previously KUnit assumed that printk would always be present, which is >> not a valid assumption to make. Fix that by removing call to >> vprintk_emit, and calling printk directly. >> >> Reported-by: Randy Dunlap >> Link: https://lore.kernel.org/linux-kselftest/0352fae9-564f-4a97-715a-fabe016259df@kernel.org/T/#t >> Cc: Stephen Rothwell >> Cc: Sergey Senozhatsky >> Signed-off-by: Brendan Higgins > > [..] > >> -static void kunit_vprintk(const struct kunit *test, >> - const char *level, >> - struct va_format *vaf) >> -{ >> - kunit_printk_emit(level[1] - '0', "\t# %s: %pV", test->name, vaf); >> -} > > This patch looks good to me. I like the removal of recursive > vsprintf() (%pV). > > -ss > Hi Sergey, What are the guidelines for using printk(). I recall some discussion about not using printk(). I am seeing the following from checkpatch script: WARNING: Prefer [subsystem eg: netdev]_level([subsystem]dev, ... then dev_level(dev, ... then pr_level(... to printk(KERN_LEVEL ... #105: FILE: include/kunit/test.h:343: + printk(KERN_LEVEL "\t# %s: " fmt, (test)->name, ##__VA_ARGS__) Is there supposed to be pr_level() - I can find dev_level() cc'ing Joe Perches for his feedback on this message recommending pr_level() which isn't in 5.3. thanks, -- Shuah thanks, -- Shuah