Received: by 10.223.164.202 with SMTP id h10csp1038482wrb; Sun, 26 Nov 2017 18:34:56 -0800 (PST) X-Google-Smtp-Source: AGs4zMZ75Zak/C4HkrMtbPeq+JOqWoH9NgeOb/Xw2F4XGmbH0/rpNOa3AmELfqlP45oWLm48eKzq X-Received: by 10.159.198.148 with SMTP id g20mr36301206plo.89.1511750096376; Sun, 26 Nov 2017 18:34:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511750096; cv=none; d=google.com; s=arc-20160816; b=imLmIxyvcHNti84Dpx+LvZnLvJ8xcbZFXg5jaQnTfLVU1Cb73ayBpIgmX0KM2/Dh41 oce0ilTn5K5Rda0FNhNLXkRCVL5mPYmi2zniiFCxqpFMZPZGUAI3HWkz7byZGeLXBek1 Z8Ml2DoSG3RXRwtBTh/Ed7P9RZX7aXZbd+XrUvMADcQZDvRVLYJSN+ub7ix76ZM80iRp oT0lqPmOpSX23bsNPn3DOtBv3DdqpZb82CpEejZ/NVU6GeDtDVIRzFyGCsupuP2b4w6x 2uJAPzEZ/2yfD82Za03J4CNSYd9vbgHsXxOY7SFi+jvFQU00kk//GLac02E70tWqeIFp 7rKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=fIXUrzROKvzWvnyM52C5Kjy6+Bymb6U5BFY/efEF6dU=; b=lcE8kKuakaXe/oG6BjavrinHjlSLJNXy2dXd2eVOvYFn9worNQ0ABA4rowr6LdVbVL 9tsB4XLj0WPyJTSzhsommQxxXLTlr7GTyEeCmj53GpRBKCswHCHQDZAGd00ZaCB2AU3q 0U4pnWTLOC4S/M5dv1ZI7QmX/RgIKFYIqXobQ7ntf9SY+s8TMDLaD2EBDIOz7fEMO3pw k7pvfs94XuIzfd2QLKORD0TTe/pnvvudByqG0fhACu3SIxxPtB7CXGWXJmUMosbkGMcs 6aPRUyPMal92Jx4T/p8Joj6U7fMY2NTqUeA0vBPD+ErATO4R2gel2fahKeawUM2a4667 TPlA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w2si21230934plp.715.2017.11.26.18.34.44; Sun, 26 Nov 2017 18:34:56 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751252AbdK0CeF (ORCPT + 77 others); Sun, 26 Nov 2017 21:34:05 -0500 Received: from smtp2.provo.novell.com ([137.65.250.81]:47504 "EHLO smtp2.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750872AbdK0CeD (ORCPT ); Sun, 26 Nov 2017 21:34:03 -0500 Received: from localhost.localdomain (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) by smtp2.provo.novell.com with ESMTP (TLS encrypted); Sun, 26 Nov 2017 19:34:01 -0700 From: Davidlohr Bueso To: acme@kernel.org Cc: jolsa@redhat.com, ak@linux.intel.com, mingo@redhat.com, dave@stgolabs.net, linux-kernel@vger.kernel.org Subject: [PATCH -tip 0/7] tools/perf: Update rbtree implementation and optimize users Date: Sun, 26 Nov 2017 18:30:39 -0800 Message-Id: <20171127023046.19139-1-dave@stgolabs.net> X-Mailer: git-send-email 2.13.6 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, The following optimizes the rb_first() lookups in perf tooling such that we can avoid walking down the tree finding the first element. Tree traversals (and overall computing the first node in the tree) is a surprisingly common operation. The first patch adds the updated implementation of rbtrees, including the cached interfaces, taken from the kernel. The rest of the patches make use of this for the users I thought might care the most. With these patches I am able to build and use perf without anything going wrong (but needs more testing no doubt, as changes while redundant can be a little tricky depending on if the user get smart about the trees). I'm sorry if some patches seem too big, I've tried to split them the best I could. Applies on today's -tip tree. Please consider for v4.16. Thanks! Davidlohr Bueso (7): tools/perf: Update rbtree implementation perf machine: Use cached rbtrees perf callchain: Use cached rbtrees perf util: Use cached rbtree for rblists perf symbols: Use cached rbtrees perf hist: Use cached rbtrees perf sched: Use cached rbtrees tools/include/linux/rbtree.h | 50 ++++++++- tools/include/linux/rbtree_augmented.h | 60 ++++++++-- tools/lib/rbtree.c | 171 ++++++++++++++++++++-------- tools/perf/builtin-annotate.c | 4 +- tools/perf/builtin-c2c.c | 6 +- tools/perf/builtin-diff.c | 10 +- tools/perf/builtin-report.c | 2 +- tools/perf/builtin-sched.c | 45 ++++---- tools/perf/builtin-top.c | 6 +- tools/perf/tests/hists_common.c | 8 +- tools/perf/tests/hists_cumulate.c | 19 ++-- tools/perf/tests/hists_link.c | 8 +- tools/perf/tests/hists_output.c | 32 +++--- tools/perf/tests/vmlinux-kallsyms.c | 3 +- tools/perf/ui/browsers/hists.c | 16 +-- tools/perf/ui/gtk/hists.c | 6 +- tools/perf/ui/stdio/hist.c | 3 +- tools/perf/util/build-id.c | 12 +- tools/perf/util/dso.c | 7 +- tools/perf/util/dso.h | 6 +- tools/perf/util/hist.c | 198 ++++++++++++++++++--------------- tools/perf/util/hist.h | 10 +- tools/perf/util/intlist.h | 2 +- tools/perf/util/machine.c | 52 +++++---- tools/perf/util/machine.h | 4 +- tools/perf/util/map.c | 8 +- tools/perf/util/metricgroup.c | 2 +- tools/perf/util/probe-event.c | 3 +- tools/perf/util/rblist.c | 30 +++-- tools/perf/util/rblist.h | 2 +- tools/perf/util/sort.h | 4 +- tools/perf/util/srcline.c | 21 ++-- tools/perf/util/srcline.h | 6 +- tools/perf/util/stat-shadow.c | 2 +- tools/perf/util/strlist.h | 2 +- tools/perf/util/symbol.c | 85 +++++++------- tools/perf/util/symbol.h | 12 +- tools/perf/util/symbol_fprintf.c | 3 +- 38 files changed, 570 insertions(+), 350 deletions(-) -- 2.13.6 From 1585507772352648893@xxx Thu Nov 30 16:07:20 +0000 2017 X-GM-THRID: 1585491498407736730 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread