Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp992094pxb; Fri, 22 Apr 2022 16:10:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzNKikgdGUYVdPftju8n9e+sypG3LYoPAnj1Ejls6fDj/ZZVzGljiM7dYXLp2e+5PhFAdyX X-Received: by 2002:a62:2504:0:b0:505:7693:b48e with SMTP id l4-20020a622504000000b005057693b48emr7386478pfl.4.1650669038451; Fri, 22 Apr 2022 16:10:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650669038; cv=none; d=google.com; s=arc-20160816; b=H4yKcIj2WoLEAIkTvNpnv/rjIwtXz9ma0sqL7uxOiToNQ5Mv6hrwRbPndJhJEzSlHx /8rov1W0CvuVJkqguGoMrcJtqT6StftaYHtf9s5CGF8KM/kaRRxHD7guvQJWBAoI2mAs X+ZtyMVcoBY5KQm0kH189VSPfWhUS0cEk+dJu5KqZ8zDXRiZszTYlj8w1uhXo6tFAxgL jMUKuMsXBO+PEH41uOuJcAdEcrz3eNnh+u2XthH+d5ZBh3BJI7bjS5cTz8KVjZu92RnV JCpC4hFxjEUqnB7hoN/LPHjaDp7BSA2/TNWAB5M2zJxaDZfIIyKYo6I7U8CsgDj8nb5d m7mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=mmekTtGNYDrFi+3/xvCZ1cyXx4Buaz33XCK4R9gedqQ=; b=rBHOn/11f6fGmXCpE1qd0E0gtR08OVe5qdOmz5xwZFvDNgPMrrHbjNGuExaoY8Lq/4 shI7bp26j5dg/LlrVP2cMFuGJIanDWJPEqoj1SSLziCfQnZi7N6jx3N+HYQB5U7ytupP KUsFirwmDZMbTLSrv8JX+AlKB67UK0rqzn0KwFRXB+UxUyMUQJu9rt7PrcG9RPTza9fv b+A1Pio/mzzB11rxGeQOUuMnzAmWY3X6iwUPO6h3GxyHCnPSImMG07P/XzNTrc5M4Qke jx7I3Pl9I0SCRlof+hjJrdPu5eZsEI1mKBrB33jQakhFwUGILkFsMpKma2FRMVcOxPFC ah2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=XRmSC3KE; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id 123-20020a630181000000b003aa7173290esi8466401pgb.374.2022.04.22.16.10.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 16:10:38 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=XRmSC3KE; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D4FC330AA54; Fri, 22 Apr 2022 15:11:02 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232041AbiDVWLc (ORCPT + 99 others); Fri, 22 Apr 2022 18:11:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231980AbiDVWJf (ORCPT ); Fri, 22 Apr 2022 18:09:35 -0400 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C064A17C52F; Fri, 22 Apr 2022 13:56:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1650660986; x=1682196986; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=yeFOddTCv1hFODhcqnXCok1cU7wxOpGFwvo6C+IJ2dc=; b=XRmSC3KE8fdGj2OlK72S67GYg0OdzgPGZThUc92ra/5CFHsib0XCXV3w J05eZIeSmfCE+TFxVJ1GfIzB3c2G1XRtxRi178RBsAYH1elb+rGxEtZnu ylJYDHpfKEfXh3Mdy5ixCnShM83CUz8FGCe/vTkzu+FM5ODxukdTFAqNW wO6AEJiir3c0PnLTLq9lNZYH/+6N2cBKgMmgJD6UTjXwzujuPaXdM2SsS 06qYEIFN1ZK5VsITyAYRCuhOG8bxDDh4nGJ+VJDFfDL+JWYygYFPIJXyZ DnmbYCJ0vjVSXVvbOe2v/n/sMpP7fLDC7impNY9fNUlH5yq8oXp3L5P2M Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10324"; a="289897473" X-IronPort-AV: E=Sophos;i="5.90,282,1643702400"; d="scan'208";a="289897473" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Apr 2022 13:02:29 -0700 X-IronPort-AV: E=Sophos;i="5.90,282,1643702400"; d="scan'208";a="511719363" Received: from agluck-desk3.sc.intel.com ([172.25.222.78]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Apr 2022 13:02:29 -0700 From: Tony Luck To: hdegoede@redhat.com, markgross@kernel.org Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, corbet@lwn.net, gregkh@linuxfoundation.org, andriy.shevchenko@linux.intel.com, jithu.joseph@intel.com, ashok.raj@intel.com, tony.luck@intel.com, rostedt@goodmis.org, dan.j.williams@intel.com, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, platform-driver-x86@vger.kernel.org, patches@lists.linux.dev, ravi.v.shankar@intel.com Subject: [PATCH v4 09/10] trace: platform/x86/intel/ifs: Add trace point to track Intel IFS operations Date: Fri, 22 Apr 2022 13:02:18 -0700 Message-Id: <20220422200219.2843823-10-tony.luck@intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220422200219.2843823-1-tony.luck@intel.com> References: <20220419163859.2228874-1-tony.luck@intel.com> <20220422200219.2843823-1-tony.luck@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add tracing support which may be useful for debugging systems that fail to complete In Field Scan tests. Reviewed-by: Dan Williams Signed-off-by: Tony Luck --- MAINTAINERS | 1 + drivers/platform/x86/intel/ifs/runtest.c | 5 ++++ include/trace/events/intel_ifs.h | 38 ++++++++++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 include/trace/events/intel_ifs.h diff --git a/MAINTAINERS b/MAINTAINERS index d2ee63193ab3..abcf9b895ea8 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -9867,6 +9867,7 @@ R: Ashok Raj R: Tony Luck S: Maintained F: drivers/platform/x86/intel/ifs +F: include/trace/events/intel_ifs.h INTEL INTEGRATED SENSOR HUB DRIVER M: Srinivas Pandruvada diff --git a/drivers/platform/x86/intel/ifs/runtest.c b/drivers/platform/x86/intel/ifs/runtest.c index c30cc9c95b4f..d6cb5d9e44c2 100644 --- a/drivers/platform/x86/intel/ifs/runtest.c +++ b/drivers/platform/x86/intel/ifs/runtest.c @@ -23,6 +23,9 @@ static atomic_t siblings_out; static int cpu_sibl_ct; static bool scan_enabled = true; +#define CREATE_TRACE_POINTS +#include + struct ifs_work { struct work_struct w; struct device *dev; @@ -216,6 +219,8 @@ static void ifs_work_func(struct work_struct *work) rdmsrl(MSR_SCAN_STATUS, status.data); + trace_ifs_status(activate, status); + /* Some cases can be retried, give up for others */ if (!can_restart(status)) break; diff --git a/include/trace/events/intel_ifs.h b/include/trace/events/intel_ifs.h new file mode 100644 index 000000000000..0611f370cb37 --- /dev/null +++ b/include/trace/events/intel_ifs.h @@ -0,0 +1,38 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM intel_ifs + +#if !defined(_TRACE_IFS_H) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_IFS_H + +#include +#include + +TRACE_EVENT(ifs_status, + + TP_PROTO(union ifs_scan activate, union ifs_status status), + + TP_ARGS(activate, status), + + TP_STRUCT__entry( + __field( u64, status ) + __field( u8, start ) + __field( u8, stop ) + ), + + TP_fast_assign( + __entry->start = activate.start; + __entry->stop = activate.stop; + __entry->status = status.data; + ), + + TP_printk("start: %.2x, stop: %.2x, status: %llx", + __entry->start, + __entry->stop, + __entry->status) +); + +#endif /* _TRACE_IFS_H */ + +/* This part must be outside protection */ +#include -- 2.35.1