Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1398767ybn; Wed, 25 Sep 2019 17:46:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqzPzBYoNVWvN6ITPt23KYIrRpnL/Ouy1OrKQzcVjeXLSLRSoidKtP6HLEB80YTfkJCavLDZ X-Received: by 2002:a17:906:e288:: with SMTP id gg8mr876736ejb.24.1569458775774; Wed, 25 Sep 2019 17:46:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569458775; cv=none; d=google.com; s=arc-20160816; b=YSm8zLZJR+ZLsWbTC+5sMwlo0LOEPD2ic+S+zeiv5UZ5npYpuff5ypdLV4lRgo5cUy +AvzpA8J4OoLZFXvegMqxwWDWHfQwQRFjlfH6eglPg88cXr+DOorEUqDHwlochMdYNYS W+5z9u9ehjtpOylmE6pndsJqNcpV3LACOwfz66TZvqLj7NhiEE0Gpt4aoZi1LmLqupSh jPsYbGLQfPnp8sUwSXB18hqvxjhUhRryjhB0tNIm8nRnVYwP372ch7f+VPiZ+L49m6Dy IlibKVp5ukjRha/dm0nWNmpOSKJNnfMjMC883FexnN29h/3LukpZu89/SSeHT9lqjACH SQJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=KOtSEXE666OsB9YWmhgwBesxLdaU+jdX8N9BR9adYF4=; b=ahHZOqeTXYAYs5/cxnd4ElZfuHdtgqbDaAHswgKC6Q9tnM/GOdvc7+gd+TkvpiuF16 vkG2+xfGV8vLOtLU23+RFevvme/aD/Tua8gOv6uxheTMrLPfplf6NhjRUfXXFoQyXLjU GWrh4EHIrk5uaTnS8UrdKBM3CFIG02Tj24rzJQi67biwUdCDjWaohMb3VWD1prLounqU XcvfOcZQpr5lkCnh30fsfe3ONzUhF6n4CsHAX5OaC7ZfVVm5reGfkMhwMv+ET8Kx89F8 GrYq3CckhSviifZOKd/C4i9gLSbC2OJ5y/X7v+nuYoOEG/9+gIBLCXqMH2Ng72loJIeh BxIw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i40si376488eda.225.2019.09.25.17.45.52; Wed, 25 Sep 2019 17:46:15 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2503926AbfIXHoL (ORCPT + 99 others); Tue, 24 Sep 2019 03:44:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56847 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2503745AbfIXHoK (ORCPT ); Tue, 24 Sep 2019 03:44:10 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DDF0818C4265; Tue, 24 Sep 2019 07:44:09 +0000 (UTC) Received: from krava (unknown [10.43.17.52]) by smtp.corp.redhat.com (Postfix) with SMTP id BA89580A5; Tue, 24 Sep 2019 07:44:08 +0000 (UTC) Date: Tue, 24 Sep 2019 09:44:07 +0200 From: Jiri Olsa To: Andi Kleen Cc: acme@kernel.org, jolsa@kernel.org, linux-kernel@vger.kernel.org, Andi Kleen Subject: Re: [PATCH 2/3] perf, expr: Remove assert usage Message-ID: <20190924074407.GB26797@krava> References: <20190923233339.25326-1-andi@firstfloor.org> <20190923233339.25326-2-andi@firstfloor.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190923233339.25326-2-andi@firstfloor.org> User-Agent: Mutt/1.12.1 (2019-06-15) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.62]); Tue, 24 Sep 2019 07:44:09 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 23, 2019 at 04:33:38PM -0700, Andi Kleen wrote: > From: Andi Kleen > > My "compile perf statically" setup doesn't like this assert > for unknown reasons. Replace it with a standard BUG_ON > > Signed-off-by: Andi Kleen > --- > tools/perf/util/expr.y | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/tools/perf/util/expr.y b/tools/perf/util/expr.y > index f9a20a39b64a..5086a941295a 100644 > --- a/tools/perf/util/expr.y > +++ b/tools/perf/util/expr.y > @@ -6,7 +6,6 @@ > #define IN_EXPR_Y 1 > #include "expr.h" > #include "smt.h" > -#include > #include > > #define MAXIDLEN 256 > @@ -172,7 +171,8 @@ static int expr__lex(YYSTYPE *res, const char **pp) > void expr__add_id(struct parse_ctx *ctx, const char *name, double val) > { > int idx; > - assert(ctx->num_ids < MAX_PARSE_ID); > + > + BUG_ON(ctx->num_ids >= MAX_PARSE_ID); hi, getting compilation fail LINK perf /usr/bin/ld: perf-in.o: in function `expr__add_id': /home/jolsa/kernel/linux-perf/tools/perf/util/expr.y:175: undefined reference to `BUG_ON' collect2: error: ld returned 1 exit status make[2]: *** [Makefile.perf:609: perf] Error 1 make[1]: *** [Makefile.perf:221: sub-make] Error 2 make: *** [Makefile:70: all] Error 2 jirka > idx = ctx->num_ids++; > ctx->ids[idx].name = name; > ctx->ids[idx].val = val; > -- > 2.21.0 >