From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jiri Olsa Subject: Re: [PATCH 06/10] perf report: Add 'cgroup' sort key Date: Fri, 6 Mar 2020 15:10:11 +0100 Message-ID: <20200306141011.GB290743@krava> References: <20200224043749.69466-1-namhyung@kernel.org> <20200224043749.69466-7-namhyung@kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20200224043749.69466-7-namhyung@kernel.org> Sender: linux-kernel-owner@vger.kernel.org To: Namhyung Kim Cc: Ingo Molnar , Peter Zijlstra , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Stephane Eranian , LKML , linux-perf-users@vger.kernel.org List-Id: linux-perf-users.vger.kernel.org On Mon, Feb 24, 2020 at 01:37:45PM +0900, Namhyung Kim wrote: SNIP > @@ -634,6 +637,39 @@ struct sort_entry sort_cgroup_id = { > .se_width_idx = HISTC_CGROUP_ID, > }; > > +/* --sort cgroup */ > + > +static int64_t > +sort__cgroup_cmp(struct hist_entry *left, struct hist_entry *right) > +{ > + return right->cgroup - left->cgroup; > +} > + > +static int hist_entry__cgroup_snprintf(struct hist_entry *he, > + char *bf, size_t size, > + unsigned int width __maybe_unused) > +{ > + const char *cgrp_name = "N/A"; > + > + if (he->cgroup) { > + struct cgroup *cgrp = cgroup__find(he->ms.maps->machine->env, eveything is connected :)) great that this one works jirka