Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp892778yba; Thu, 18 Apr 2019 11:19:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqyejbpjQsrvRlKqcJiVotpefEs4tC2JvleL5SLVcyuRCAvFt0U0K6dj+2ModUjKRCM5hw8u X-Received: by 2002:a62:ac08:: with SMTP id v8mr96855325pfe.42.1555611556363; Thu, 18 Apr 2019 11:19:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555611556; cv=none; d=google.com; s=arc-20160816; b=ApwOfupl7BmoCYTUfqjxWgcBKt5RHjc4DK24pxw6jIOWCanNSUDldT8C0gUI6R5a4/ Y92JlDBLFP/OXrse3yvvgT4+q63xU/OeBiQz53NfT9Nhl6AObEm7/KmLl6xBfWQFXO8z iDt8GPGHOfVkcqQMSy4/WjjmnsfaLt6PTxsV+d7oHIPjZ3YKK0e+/k19aa6wcqvxWf+i T0WkrMvSKyCXsenwoDFQEevy492W7s6kYnSVTvc8+AAwaGuuRLu2dTs5qU7zu5C14gYZ D6qhcBvuoA5P/6S7c2d2k7JKv7otgVJTywIAEjGytlYjleWyvr8qO/O4WXEdQxCXQZAq EjUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=jyOV1HghQqKPKztWdHYdEt7aZHu8eCeHcA7Hbf9j8H8=; b=fN5ujWqncuRZROl9oYhSX8oLWExQTfgtoNdr2pyjW1IqQpRwH3TMkN9IOdQ5i5ffI/ gsvnFz6nuG20XsK8faAov7HSWGrDl4wb1sMo7A4HPfZuOP4u7lRwdUv1bg8oEelijMMB axIpvdp6VNqdLokdjSb7KK7FcxSUxtzVQA8BMoN6oE9Of4ZnlSMEuw0gEEmPKMShHmbv YAZd/lEA9Ncjne/S5wt52YGrHe08nXLCFsegIEXx5Un9h5B304sGJruTmZg3OmLJG5cA npXIsKxEaUz5MFfDblGt8cdQ1YAI3qNK2bTb1wU8ZKu4QOmGaBTmzXAEUXQ17bYSrb2q cBdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=kLcmpgEx; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a8si2759949pla.362.2019.04.18.11.19.01; Thu, 18 Apr 2019 11:19:16 -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=@kernel.org header.s=default header.b=kLcmpgEx; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391989AbfDRSMJ (ORCPT + 99 others); Thu, 18 Apr 2019 14:12:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:44512 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391980AbfDRSMH (ORCPT ); Thu, 18 Apr 2019 14:12:07 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7B2D921871; Thu, 18 Apr 2019 18:12:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555611126; bh=NhXdt7TgWnNs+QEsbVp2LFmUXZjDpAh4OV8VssSm5fI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kLcmpgExJWdyUsbvpLdyBytynHIyCsrqfApDK7pp9W/Sqo1VYw2qG5O5p/77jxpi7 nBuvgfmbSKd6oP7EOT5RlZ3u2tf45PlKj5g/87UaS7TED/1bZJ7pXQO5V8pI4zGEm5 bCjJHY0ulgOh2v7BIzsJqS4EbBPsUyTYhuIgr6zE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Changbin Du , Jiri Olsa , Alexei Starovoitov , Daniel Borkmann , Namhyung Kim , Peter Zijlstra , "Steven Rostedt (VMware)" , Arnaldo Carvalho de Melo , Sasha Levin Subject: [PATCH 5.0 35/93] perf tools: Fix errors under optimization level -Og Date: Thu, 18 Apr 2019 19:57:13 +0200 Message-Id: <20190418160440.660287035@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190418160436.781762249@linuxfoundation.org> References: <20190418160436.781762249@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 11c1ea6f1a9bc97bf857fd12f72eacb6c69794e2 ] Optimization level '-Og' offers a reasonable level of optimization while maintaining fast compilation and a good debugging experience. This patch tries to make it work. $ make DEBUG=1 EXTRA_CFLAGS='-Og' bench/epoll-ctl.c: In function ‘do_threads’: bench/epoll-ctl.c:274:9: error: ‘ret’ may be used uninitialized in this function [-Werror=maybe-uninitialized] return ret; ^~~ ... Signed-off-by: Changbin Du Reviewed-by: Jiri Olsa Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Steven Rostedt (VMware) Link: http://lkml.kernel.org/r/20190316080556.3075-4-changbin.du@gmail.com Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin --- tools/lib/bpf/libbpf.c | 2 +- tools/perf/bench/epoll-ctl.c | 2 +- tools/perf/bench/epoll-wait.c | 2 +- tools/perf/tests/backward-ring-buffer.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c index 169e347c76f6..9ba1a2e1ed7a 100644 --- a/tools/lib/bpf/libbpf.c +++ b/tools/lib/bpf/libbpf.c @@ -627,7 +627,7 @@ bpf_object__init_maps(struct bpf_object *obj, int flags) bool strict = !(flags & MAPS_RELAX_COMPAT); int i, map_idx, map_def_sz, nr_maps = 0; Elf_Scn *scn; - Elf_Data *data; + Elf_Data *data = NULL; Elf_Data *symbols = obj->efile.symbols; if (obj->efile.maps_shndx < 0) diff --git a/tools/perf/bench/epoll-ctl.c b/tools/perf/bench/epoll-ctl.c index 0c0a6e824934..2af067859966 100644 --- a/tools/perf/bench/epoll-ctl.c +++ b/tools/perf/bench/epoll-ctl.c @@ -224,7 +224,7 @@ static int do_threads(struct worker *worker, struct cpu_map *cpu) pthread_attr_t thread_attr, *attrp = NULL; cpu_set_t cpuset; unsigned int i, j; - int ret; + int ret = 0; if (!noaffinity) pthread_attr_init(&thread_attr); diff --git a/tools/perf/bench/epoll-wait.c b/tools/perf/bench/epoll-wait.c index 5a11534e96a0..fe85448abd45 100644 --- a/tools/perf/bench/epoll-wait.c +++ b/tools/perf/bench/epoll-wait.c @@ -293,7 +293,7 @@ static int do_threads(struct worker *worker, struct cpu_map *cpu) pthread_attr_t thread_attr, *attrp = NULL; cpu_set_t cpuset; unsigned int i, j; - int ret, events = EPOLLIN; + int ret = 0, events = EPOLLIN; if (oneshot) events |= EPOLLONESHOT; diff --git a/tools/perf/tests/backward-ring-buffer.c b/tools/perf/tests/backward-ring-buffer.c index 6d598cc071ae..1a9c3becf5ff 100644 --- a/tools/perf/tests/backward-ring-buffer.c +++ b/tools/perf/tests/backward-ring-buffer.c @@ -18,7 +18,7 @@ static void testcase(void) int i; for (i = 0; i < NR_ITERS; i++) { - char proc_name[10]; + char proc_name[15]; snprintf(proc_name, sizeof(proc_name), "p:%d\n", i); prctl(PR_SET_NAME, proc_name); -- 2.19.1