From patchwork Fri Sep 18 14:47: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: 53889 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by patches.linaro.org (Postfix) with ESMTPS id 650F6218E3 for ; Fri, 18 Sep 2015 14:48:13 +0000 (UTC) Received: by wicgb1 with SMTP id gb1sf9794250wic.3 for ; Fri, 18 Sep 2015 07:48:12 -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: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=Q6Rl4Jnifmb9I87pDd9OyymvKnSfWGZM0x3nhtfpqvCT3BWYT0u+y1wYwZ4vRE7T5G H8mevpUmG9sE+f7jSIhY9ob+5klSQ2XCxW+GULUN2m1DUsLtwudpTlRblfb9cD2lrS+c Z4PRPcUK2/WLb9gjN6K/+Ji29AmKGBsHK1QPdi3YO17B2Hqi3hNHJqP+Tkakszq0DVLD O+9mFRP3o4vTurqVDBUzzGuDk2yDd9uruUmAoKt3riijL3Ox2v9SM6CbwY/HbE1dXssF gk92V3lDcXa9InPaPSjeYy5LpIDtI/pZDoQJtYZe8BMyr4o2ZfuTDluj7mCNm/ZWN2RD NeKw== X-Gm-Message-State: ALoCoQmDXIBpTpo9lGGurfmLxJ2XyhVOYkjoCwxXEr5lEkuAQRKBGHE5qzZPzDUABgxut+b9du+3 X-Received: by 10.180.107.167 with SMTP id hd7mr1939391wib.6.1442587692657; Fri, 18 Sep 2015 07:48:12 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.6.67 with SMTP id y3ls218609lay.55.gmail; Fri, 18 Sep 2015 07:48:12 -0700 (PDT) X-Received: by 10.152.203.197 with SMTP id ks5mr3338307lac.50.1442587692461; Fri, 18 Sep 2015 07:48:12 -0700 (PDT) Received: from mail-la0-f50.google.com (mail-la0-f50.google.com. [209.85.215.50]) by mx.google.com with ESMTPS id s12si6211442lbp.106.2015.09.18.07.48.12 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Sep 2015 07:48:12 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) client-ip=209.85.215.50; Received: by lagj9 with SMTP id j9so32330714lag.2 for ; Fri, 18 Sep 2015 07:48:12 -0700 (PDT) X-Received: by 10.112.135.9 with SMTP id po9mr3423813lbb.56.1442587691986; Fri, 18 Sep 2015 07:48:11 -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 w3csp339801lbq; Fri, 18 Sep 2015 07:48:11 -0700 (PDT) X-Received: by 10.50.118.42 with SMTP id kj10mr28469492igb.71.1442587690948; Fri, 18 Sep 2015 07:48:10 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 67si7067530iog.210.2015.09.18.07.48.10; Fri, 18 Sep 2015 07:48: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; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754571AbbIROsI (ORCPT + 30 others); Fri, 18 Sep 2015 10:48:08 -0400 Received: from mail-pa0-f46.google.com ([209.85.220.46]:35365 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752639AbbIROsE (ORCPT ); Fri, 18 Sep 2015 10:48:04 -0400 Received: by pacfv12 with SMTP id fv12so54015789pac.2 for ; Fri, 18 Sep 2015 07:48:04 -0700 (PDT) X-Received: by 10.66.229.67 with SMTP id so3mr7841218pac.66.1442587684262; Fri, 18 Sep 2015 07:48:04 -0700 (PDT) Received: from t430.cg.shawcable.net ([184.64.168.246]) by smtp.gmail.com with ESMTPSA id hp4sm9474990pbc.68.2015.09.18.07.48.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 18 Sep 2015 07:48:03 -0700 (PDT) From: Mathieu Poirier To: mathieu.poirier@linaro.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] coresight: etm3x: adding cpu affinity to sysFS interface Date: Fri, 18 Sep 2015 08:47:41 -0600 Message-Id: <1442587661-1796-1-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 1.9.1 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.215.50 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);