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: 141683 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp4803504ljj; Wed, 11 Jul 2018 00:46:24 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeVc4YIjRlmDK/yLaA7ax++xkPERWBj89emRpmTaCgALNk0qUk0TnQmMCfgvjizQp8yZHfz X-Received: by 2002:a17:902:88:: with SMTP id a8-v6mr27148222pla.156.1531295184847; Wed, 11 Jul 2018 00:46:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531295184; cv=none; d=google.com; s=arc-20160816; b=U3FjYnOpIUgoXN3CRX7eaOZx5dwo/kUoGdyO5Z5jXnt/nRQ3VDBQB72QiyuoZWgD9A FROCGjMSkZiiCld38unpfnpf+UFBPDCWjCEoLc/VUH01yPXXA/aREE4dSpDGnG9lYBo1 oYElRjy4DBszlbL8k7gDDcuiX+sLU0lEjAAQAij5U5lQxSuuz69aDY9zHkWuNXmWpGWM 5CkO+2UY89bVZMa6hCmGubQGd6NtN3XgpP5OEtpKTCv8JrHxWxcfkhXMnF3USkjnFJ+Y JxU4ubfa2LV/Xm/MIzvzrPIHm9OYc+9rYE+Ymbjq7C8NAPcTVHwVP85vkODMBdfUKvF3 9GqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=vW3cqebjdlydqMs6JbHwBlmxXx9urlbBEoZPw9FFXQA=; b=pYn5oBcZX4NF1fMFfsCY2lcLLK9pe75NeBiAKkZaARF/+/jrNtj8H6aZmVZAFGYimj EXX7lWQ+vB/p0t3rPlUC5xY7W9nQvXIcnYCLvDDB/HU+ln8QbL31/9ga/dWzPrK/Qsu7 k4LkAz1FRtY0wDek0Hvg5RuxgOmRX7/0SEUqNnRS0215aRAY3CAJ6shtjckutsPaaBsc HNfcIiq3yWw8vUAhLueTlEzPMxh+IJKyfw/qXmSbqd/b/1WsbaP9TdRy+GlA0cQ8Fxox bQes+kXBrQZjg9KPEfIQ040AuUiDuUsk2Xad8G0CzDKUydEWeLdjoxX/t6MAFYmsru29 ztng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="E/m+IA6t"; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i2-v6si17752566pgo.121.2018.07.11.00.46.24; Wed, 11 Jul 2018 00:46:24 -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=@linaro.org header.s=google header.b="E/m+IA6t"; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726566AbeGKHtT (ORCPT + 22 others); Wed, 11 Jul 2018 03:49:19 -0400 Received: from mail-pl0-f54.google.com ([209.85.160.54]:43284 "EHLO mail-pl0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725866AbeGKHtT (ORCPT ); Wed, 11 Jul 2018 03:49:19 -0400 Received: by mail-pl0-f54.google.com with SMTP id c41-v6so8810644plj.10 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=nakq/hyRXtxLit8a+IwYEBUuHgEzgKz2weCZYaVuWPiHuTFkOl6JgjV0GK837dwtWD a21Hpob8MT8A5L3xhq2B0BMv1WlOLO89Ps4ZPPLkeIMGq2/e+AfqHVgqrOK7KB7rfaGC rVU9iOiToF1QHUecMvBJfTsqpOipPutFiWJFa++93XbbCV9OpMwFpRQK7+xYIFKSqZxn 4Ua2pUV1ytQT5BNuKU70/2qjXngsknYhvbQ6kBOxYnpZTOXQtmGEXVO1i65ABGZph5Zw c2qXbtxOraG65UZZbF5zG8N+cDRn2J6O6wE/PZ917gbc70qlqEdG4yhTyv/IUuZyJk/I DH7w== X-Gm-Message-State: APt69E2dbzOzwyFE2NIJUw0XbfQH6qRez4hTup9uq/p8gdMeUOwDCyVi LYD5LHcVPZ0I/FH3lqyaXDXmEA== 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 Cc: Leo Yan 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.7.4 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;