From patchwork Wed Oct 7 15:26:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 54594 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by patches.linaro.org (Postfix) with ESMTPS id B2ABC22FEF for ; Wed, 7 Oct 2015 15:28:33 +0000 (UTC) Received: by lbbti1 with SMTP id ti1sf8844277lbb.3 for ; Wed, 07 Oct 2015 08:28:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=t53UxjErH1cjK6PSFrDPpMeaSGEF/K41UCqeILxKqls=; b=cDs63GruumGBELT8qK0jEqZ4O9Y4Fl8ebM9SAtHnmqnAhFsrCeQjG9+XMH0KUWcss2 AlEin5LDcQegkHPRVL3aQZ7bIb+cGHkL702nMt9o0R1DbjYIqcBkMqKCYB7JURVcw7kY IqJzOfkqYSGbMGK2tX80bxjUzo8MlixKZg7zxaZ9Cr9TaNS3FDf7pLIt7+kdzfVupt8V hkRW/i9p6d+D37XxYLj5Nf6rtZeAIs3iSrQALjL338NiO7Borbev6wYZ6n0eh0KEEFjF fimiOubiODnboLD/Lrm7Q/19niEXuAV3/tbdUVwwbNpwILaJVHDOZzgz3hOwXiWGWJRW BSMg== X-Gm-Message-State: ALoCoQlKvv4ARDc0z8vrUO+X1nV27VfSNTaeqzGBSjz6RxRWTeDc+Gnh0ygxwVpSileqxj+xwhn3 X-Received: by 10.194.156.193 with SMTP id wg1mr370438wjb.3.1444231712660; Wed, 07 Oct 2015 08:28:32 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.21.166 with SMTP id 38ls82087lfv.22.gmail; Wed, 07 Oct 2015 08:28:32 -0700 (PDT) X-Received: by 10.112.72.193 with SMTP id f1mr962335lbv.12.1444231712475; Wed, 07 Oct 2015 08:28:32 -0700 (PDT) Received: from mail-lb0-f174.google.com (mail-lb0-f174.google.com. [209.85.217.174]) by mx.google.com with ESMTPS id 83si25621541lfs.15.2015.10.07.08.28.32 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Oct 2015 08:28:32 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.174 as permitted sender) client-ip=209.85.217.174; Received: by lbcao8 with SMTP id ao8so15942924lbc.3 for ; Wed, 07 Oct 2015 08:28:32 -0700 (PDT) X-Received: by 10.112.139.201 with SMTP id ra9mr907116lbb.29.1444231712223; Wed, 07 Oct 2015 08:28:32 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp50863lbq; Wed, 7 Oct 2015 08:28:31 -0700 (PDT) X-Received: by 10.66.242.138 with SMTP id wq10mr1698907pac.2.1444231711199; Wed, 07 Oct 2015 08:28:31 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id fb1si58519464pbb.106.2015.10.07.08.28.30; Wed, 07 Oct 2015 08:28:31 -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; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754892AbbJGP22 (ORCPT + 30 others); Wed, 7 Oct 2015 11:28:28 -0400 Received: from mail-pa0-f45.google.com ([209.85.220.45]:33789 "EHLO mail-pa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754781AbbJGP1F (ORCPT ); Wed, 7 Oct 2015 11:27:05 -0400 Received: by pacex6 with SMTP id ex6so24522605pac.0 for ; Wed, 07 Oct 2015 08:27:04 -0700 (PDT) X-Received: by 10.68.237.161 with SMTP id vd1mr1714848pbc.168.1444231624644; Wed, 07 Oct 2015 08:27:04 -0700 (PDT) Received: from t430.cg.shawcable.net ([184.64.168.246]) by smtp.gmail.com with ESMTPSA id ja4sm40170570pbb.19.2015.10.07.08.27.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 07 Oct 2015 08:27:04 -0700 (PDT) From: Mathieu Poirier To: gregkh@linuxfoundation.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, mathieu.poirier@linaro.org Subject: [PATCH 4/6] coresight: etm3x: adding cpu affinity to sysFS interface Date: Wed, 7 Oct 2015 09:26:41 -0600 Message-Id: <1444231603-26676-5-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1444231603-26676-1-git-send-email-mathieu.poirier@linaro.org> References: <1444231603-26676-1-git-send-email-mathieu.poirier@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: mathieu.poirier@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.174 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Without access to the device tree, it is impossible to know what CPU a tracer is affined to. As such adding a new sysFS interface to convey the information. Signed-off-by: Mathieu Poirier --- drivers/hwtracing/coresight/coresight-etm3x.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/hwtracing/coresight/coresight-etm3x.c b/drivers/hwtracing/coresight/coresight-etm3x.c index bf2476ed9356..4797f56e7f13 100644 --- a/drivers/hwtracing/coresight/coresight-etm3x.c +++ b/drivers/hwtracing/coresight/coresight-etm3x.c @@ -1545,6 +1545,18 @@ static ssize_t status_show(struct device *dev, } static DEVICE_ATTR_RO(status); +static ssize_t cpu_show(struct device *dev, + struct device_attribute *attr, char *buf) +{ + int val; + struct etm_drvdata *drvdata = dev_get_drvdata(dev->parent); + + val = drvdata->cpu; + return scnprintf(buf, PAGE_SIZE, "%d\n", val); + +} +static DEVICE_ATTR_RO(cpu); + static ssize_t traceid_show(struct device *dev, struct device_attribute *attr, char *buf) { @@ -1621,6 +1633,7 @@ static struct attribute *coresight_etm_attrs[] = { &dev_attr_timestamp_event.attr, &dev_attr_status.attr, &dev_attr_traceid.attr, + &dev_attr_cpu.attr, NULL, }; ATTRIBUTE_GROUPS(coresight_etm);