From patchwork Wed Jul 11 07:45:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 10519073 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 380356032A for ; Wed, 11 Jul 2018 07:56:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 288EF28E06 for ; Wed, 11 Jul 2018 07:56:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1966F28E6C; Wed, 11 Jul 2018 07:56:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BBF2228E06 for ; Wed, 11 Jul 2018 07:56:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=s3Ok6lMgwMoGbLWEynrYqa7U0l1PHFo23/xto9hgTZY=; b=e3r3aZ1kdqMu+V1gLr8sUWDG8m VeRAty18TDOJNVogXpzT8fOqt9vWKPLFUCz1k+p2kHU4is/RGOSvY4YNcE/9nVf9VkudxrwGZ9HA8 kKy8GPWY8SNuzNnYrrz1MBSGzuuOVc6gfbhDheulBXlqYjQlZNwFST5eznH+ap9pUUvc0e+iJgSVv bJrNZP7yZd+MOp/qgIQzWqGFoplNe88bA2pieoFUw3MmHHpZEzUdHEB8Ifx0gTPztyWpCoC2bi96j U/zO6fiiYgnjM3V+Qt0fxzuVFDTIuz+8FCfDybju+Bv3s5BTu/GJ/SK1JFj152PyxPMSSDHZu0efI Pfu8E/Dg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fd9yz-0005nM-1n; Wed, 11 Jul 2018 07:56:17 +0000 Received: from mail-pl0-x231.google.com ([2607:f8b0:400e:c01::231]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fd9pX-0000cT-SA for linux-arm-kernel@lists.infradead.org; Wed, 11 Jul 2018 07:46:36 +0000 Received: by mail-pl0-x231.google.com with SMTP id b1-v6so8811102pls.5 for ; Wed, 11 Jul 2018 00:46:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=vW3cqebjdlydqMs6JbHwBlmxXx9urlbBEoZPw9FFXQA=; b=E/m+IA6tJldpTNUN28KPNYTUMALeXE1c3aisZSeM0vza4oUI2WypgO3EvHbSTMjl7b HE3f7QwSy0Hb4o8mEww6hSct8NA/E3R95vaVTlQqzKJZo4TKoXuzHIj/e4yI6TBXdf1m VUb2bCOaW4mhAEFlXdrMV/M02n7aSt4B7HsDw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=vW3cqebjdlydqMs6JbHwBlmxXx9urlbBEoZPw9FFXQA=; b=nuVaabhrWyT6KHlN0ncTo7l4T6LkOvZtBno1W4g7mieKaxXv/1afX9teBeVSxjyAjQ bgrxEn9POGgE6QvS9l8KUdq0BLg6AoCuPVj2V52iGiHqmRt5k0XBmifXNni55PiqGoZg B6hWHDaogFJ95LIiPm5CFKGoDr/DLJl47oqpKJYQEWQP1nAMaju8isSJBs2IfBAO9IWI XNuRD5AUgP4Ws4wTEQv3BgrHD3QY83kqEVKcBAaxaAq2mCBqNY+oYDjrvdjxetQXcVOF P/NeH5WQ3jrZSQhsaScWiq6FkKgky25RNb396OSZnbxv6TwFC7Aac0qEwTbZMp0ZMIqS U2oQ== X-Gm-Message-State: APt69E2Y5OfW+5pBEKQY+G6b8HcIS2HTsiJlF5hA4T0HU9COQeg+Ifg7 z/QAqxtyLnMkgQ+xbwmsxNTa3Q== X-Google-Smtp-Source: AAOMgpd7ooOWVKmayH4LHWEJGZqfPAQk6GNygBeVPG9mNWV4AxUyMulHFQNjpkta4PzKujp5iqYFPg== X-Received: by 2002:a17:902:d24:: with SMTP id 33-v6mr28192496plu.22.1531295181150; Wed, 11 Jul 2018 00:46:21 -0700 (PDT) Received: from localhost.localdomain (li1192-169.members.linode.com. [45.79.93.169]) by smtp.gmail.com with ESMTPSA id 16-v6sm9260374pfp.6.2018.07.11.00.46.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 11 Jul 2018 00:46:20 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Mathieu Poirier , Peter Zijlstra , Ingo Molnar , Alexander Shishkin , Jiri Olsa , Namhyung Kim , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Mike Leach , Robert Walker , Kim Phillips Subject: [PATCH v2 1/6] perf cs-etm: Introduce invalid address macro Date: Wed, 11 Jul 2018 15:45:40 +0800 Message-Id: <1531295145-596-2-git-send-email-leo.yan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1531295145-596-1-git-send-email-leo.yan@linaro.org> References: <1531295145-596-1-git-send-email-leo.yan@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180711_004632_245888_E6B97338 X-CRM114-Status: GOOD ( 15.04 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Leo Yan MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This patch introduces invalid address macro and uses it to replace dummy value '0xdeadbeefdeadbeefUL'. Reviewed-by: Mathieu Poirier Signed-off-by: Leo Yan --- tools/perf/util/cs-etm-decoder/cs-etm-decoder.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c index 4d5fc37..938def6 100644 --- a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c +++ b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c @@ -31,6 +31,8 @@ #endif #endif +#define CS_ETM_INVAL_ADDR 0xdeadbeefdeadbeefUL + struct cs_etm_decoder { void *data; void (*packet_printer)(const char *msg); @@ -261,8 +263,8 @@ static void cs_etm_decoder__clear_buffer(struct cs_etm_decoder *decoder) decoder->tail = 0; decoder->packet_count = 0; for (i = 0; i < MAX_BUFFER; i++) { - decoder->packet_buffer[i].start_addr = 0xdeadbeefdeadbeefUL; - decoder->packet_buffer[i].end_addr = 0xdeadbeefdeadbeefUL; + decoder->packet_buffer[i].start_addr = CS_ETM_INVAL_ADDR; + decoder->packet_buffer[i].end_addr = CS_ETM_INVAL_ADDR; decoder->packet_buffer[i].last_instr_taken_branch = false; decoder->packet_buffer[i].exc = false; decoder->packet_buffer[i].exc_ret = false; @@ -295,8 +297,8 @@ cs_etm_decoder__buffer_packet(struct cs_etm_decoder *decoder, decoder->packet_buffer[et].exc = false; decoder->packet_buffer[et].exc_ret = false; decoder->packet_buffer[et].cpu = *((int *)inode->priv); - decoder->packet_buffer[et].start_addr = 0xdeadbeefdeadbeefUL; - decoder->packet_buffer[et].end_addr = 0xdeadbeefdeadbeefUL; + decoder->packet_buffer[et].start_addr = CS_ETM_INVAL_ADDR; + decoder->packet_buffer[et].end_addr = CS_ETM_INVAL_ADDR; if (decoder->packet_count == MAX_BUFFER - 1) return OCSD_RESP_WAIT;