From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753926AbcGDOBo (ORCPT ); Mon, 4 Jul 2016 10:01:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56727 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753482AbcGDOBn (ORCPT ); Mon, 4 Jul 2016 10:01:43 -0400 From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: lkml , David Ahern , Ingo Molnar , Namhyung Kim , Peter Zijlstra Subject: [RFC 0/4] perf tools: Add hist_entry allocation callbacks Date: Mon, 4 Jul 2016 16:01:35 +0200 Message-Id: <1467640899-3776-1-git-send-email-jolsa@kernel.org> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 04 Jul 2016 14:01:42 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org hi, this patchset tries to add support provide own allocation zalloc/free methods for hist_entry object. The reason is to provide a way to be able to store more data within hist_entry object in a transparent way to its current usage by allocating its own hist_entry sub object. The user/app which wants to allocate its own hist_entry sub object provides following ops struct: struct hist_entry_ops *ops { void* (*new)(size_t); void (*free)(void *); } via new interface function: struct hist_entry * hists__add_entry_ops(struct hists *hists, struct hist_entry_ops *ops, ... I'm using this for c2c code to enlarge hist_entry object with large stats structure, which has no use to standard perf usage/commands. It might be used to lower the hist_entry footproint for default perf usage by uing this for things like hierarchy output that adds extra stuff into hist_entry object. Available at: git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git perf/he_ops thanks for comments, jirka --- Jiri Olsa (4): perf tools: Introduce hist_entry__init function perf tools: Do the error path hist_entry release in hist_entry__new perf tools: Introduce hist_entry_ops perf tools: Introduce hists__add_entry_ops function tools/perf/util/hist.c | 204 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------------- tools/perf/util/hist.h | 11 ++++++ tools/perf/util/sort.h | 6 ++++ 3 files changed, 148 insertions(+), 73 deletions(-)