Message ID | 20211223074541.3318938-24-irogers@google.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D2BEEC433F5 for <linux-arm-kernel@archiver.kernel.org>; Thu, 23 Dec 2021 08:05:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:From:Subject:References: Mime-Version:Message-Id:In-Reply-To:Date:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=LmxDQhzehypLwZ/uLOKJ0NHbejA6dL//BAIHsjlqwCg=; b=SRPAxzjl/sz00AmYGoMAxY1Ntf akYzK/ujGJUuYO8LPpNMYd1vCoy/rnT2BhVQllRSUkic+aaMXfpVD5SfKfXldODfnAcR31E2woa/a 2QbpuTgpmoDvNRgw+aIaosbSlusX/3KTNa/HaierrpiX4ZD3BlZqesDYHozsL6ABl5mVkMZ/AX0Q4 QEcsrUDgCfLXLFcbghZ/OfgGW5xmxLbH6jghyPncSqWOiy3h+pauI7EKNOj65aa+D3L9N/jqbLSI4 D3z26G549NW61VZly7J8NfxUCq7LQbCGsBuM9ihOKbuMP+rNIgTRQwwvVvj/vpVJpUMZikNlF2w0/ mmuYP6Ag==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0J4Z-00C69w-Ru; Thu, 23 Dec 2021 08:03:36 +0000 Received: from mail-yb1-xb49.google.com ([2607:f8b0:4864:20::b49]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0Iod-00Bznf-9P for linux-arm-kernel@lists.infradead.org; Thu, 23 Dec 2021 07:47:08 +0000 Received: by mail-yb1-xb49.google.com with SMTP id e131-20020a25d389000000b005fb5e6eb757so8558852ybf.22 for <linux-arm-kernel@lists.infradead.org>; Wed, 22 Dec 2021 23:47:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=J5Uxwz+NmtGEEgwvjL1sqJyX0/ppatr3BMcnhgtMNdI=; b=P+SChYI6l4zrhclWgOqBwpBXlMLUJiQXf8pyYNraVwtkdhs7KWxi4SHRuEs8Dijfgf kB1zINsX/1g3a6FuZyqmfEelCd7gyfYYCTtIpCFy2FxhV/ZOBHyDptAOnFsp6C3HVdhZ WkVyOVFxTKqSjMdxYGMUpMXp9RUfPetQ9mrev4LzHC+t+v611w5UC2P5sKBbddh+XkzM pg59NoJ+Ls4g/9bHvkjqV+KQiVTf3LaRBoNk7NzWdeke3jAlFx+a+gTeOmLXbtjIkBQC mTMKim6DKViJkpsGVDSFhFS1zlCWZl3Kwh+HIU/qNb+pACBdW1rcVEGSg+8ihB9wPwgx RKCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=J5Uxwz+NmtGEEgwvjL1sqJyX0/ppatr3BMcnhgtMNdI=; b=XvCyZX/Y6MjsI/WqZ2ztmPUU7VhjeZ7q8apDyNAsCn2zsgJAtB4cb7kQDqvc+u0T15 PIR8pQtZB1mCG0NVtOV614MyVwjMwiS5+Ef6Qr6WjTzwUgOiL+lmo880BjP0g+afSM2X /9PLwPQIaFf0nfxzTkrWTuxxUmIkeU0KiHT7hHWcobEwc9kz/mppTZbd0En7BFL2KkRx mjmkk8WmJ+CdFkyBIzKY6/mOyuNOe68PIPCE84TF8BfG6MpySidj5MElB9I7TVXkf7fq 2L8UZw4awgvRm6g1R0UZ+TuBto92Cgauh3fhCqKq/Y/L2qjzE4U9fSr6prMf536W30Da z1jw== X-Gm-Message-State: AOAM533r31AmDTdEekJhwcHg1/1jrtcJF7y8tGIEw1jDJnTODX0dFGx4 Bu9kJQ3Ba7a6vxl0MNYxpNOsdHfLn0M5 X-Google-Smtp-Source: ABdhPJzuyhZb4oXRwSxm+ExXDmsSz287nUms3ZLP6USDOSqq/SCugWDf3aY2ieELM5n9Z8Xd11OZuvQJU437 X-Received: from irogers.svl.corp.google.com ([2620:15c:2cd:202:4fef:90ff:589d:24ca]) (user=irogers job=sendgmr) by 2002:a25:ac23:: with SMTP id w35mr1680442ybi.341.1640245625867; Wed, 22 Dec 2021 23:47:05 -0800 (PST) Date: Wed, 22 Dec 2021 23:45:16 -0800 In-Reply-To: <20211223074541.3318938-1-irogers@google.com> Message-Id: <20211223074541.3318938-24-irogers@google.com> Mime-Version: 1.0 References: <20211223074541.3318938-1-irogers@google.com> X-Mailer: git-send-email 2.34.1.307.g9b7440fafd-goog Subject: [PATCH v2 23/48] perf stat: Fix memory leak in check_per_pkg From: Ian Rogers <irogers@google.com> To: Andi Kleen <ak@linux.intel.com>, Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>, John Garry <john.garry@huawei.com>, Kajol Jain <kjain@linux.ibm.com>, "Paul A . Clarke" <pc@us.ibm.com>, Arnaldo Carvalho de Melo <acme@kernel.org>, Riccardo Mancini <rickyman7@gmail.com>, Kan Liang <kan.liang@linux.intel.com>, Peter Zijlstra <peterz@infradead.org>, Ingo Molnar <mingo@redhat.com>, Mark Rutland <mark.rutland@arm.com>, Alexander Shishkin <alexander.shishkin@linux.intel.com>, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, Vineet Singh <vineet.singh@intel.com>, James Clark <james.clark@arm.com>, Mathieu Poirier <mathieu.poirier@linaro.org>, Suzuki K Poulose <suzuki.poulose@arm.com>, Mike Leach <mike.leach@linaro.org>, Leo Yan <leo.yan@linaro.org>, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org Cc: eranian@google.com, Ian Rogers <irogers@google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211222_234707_372094_7B1CE26F X-CRM114-Status: GOOD ( 12.79 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
Refactor perf cpumap
|
expand
|
diff --git a/tools/perf/util/stat.c b/tools/perf/util/stat.c index 5c24aca0968c..c69b221f5e3e 100644 --- a/tools/perf/util/stat.c +++ b/tools/perf/util/stat.c @@ -345,9 +345,10 @@ static int check_per_pkg(struct evsel *counter, return -ENOMEM; *key = (uint64_t)d << 32 | s; - if (hashmap__find(mask, (void *)key, NULL)) + if (hashmap__find(mask, (void *)key, NULL)) { *skip = true; - else + free(key); + } else ret = hashmap__add(mask, (void *)key, (void *)1); return ret;