Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3885571pxt; Tue, 10 Aug 2021 13:50:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJymoKYBVh49VZRqEXXurVvlLGKdg0S0Q/EgWG+TapkvOyQh9s0kCOpuZQ5/FPwEdjjXBd4j X-Received: by 2002:a05:6602:71a:: with SMTP id f26mr142654iox.59.1628628615649; Tue, 10 Aug 2021 13:50:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628628615; cv=none; d=google.com; s=arc-20160816; b=RbulByqjgqWvHzE1f7MGXjiaQphJBINAYQjigcBU6Lwn/Jxi7BusAXTp1YXtQscgL+ x677pV4XrcngK7ZybKixtq+tcCWX34qO5QdSonwT9TGL0n5WumsHWH/bGMd853VIXHRb 99b9fHf+qyzMnAPx41edO+laqewmoeN+AwzftykXhCgPs0ICAYBgdfNICTUcMBRv71MO wqZnBJotYwaj83/ImSMg9Bmur/qsO2XFjG23UHAAqlXI3I6qIw3efmgv6edZIZ7k5l9U IT7+Kaz+xZFfaihuJGc6xmggM77JUdHo7+0Sppuql+rzDXjF+eDL9oeW+sEhTKzIkl14 8LiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=jcWwH1sw7nQNEYhssqnp4JFew1JhAZzgoiLmbRh8PI8=; b=tPbKpTwdS0EuKjqcxnbkl0bDDCQyqwEDh3wecgjfFaBUzBFcjpB5PMgq8TBfk2EXX9 BLO6xqSKhsvHKDf85dRvE0+ejY1IgWQ44jPwiXVKjJ5ENG0HJ2nox5CNY2HO9BQ0OE05 Aoonu94OhFLDOaF62gP60g/TlYDhwF3P6fQmdg+O/TQGVAcC3pQ8ullUKWqAUr3gU0F9 GyTatnnKPq+gTYd6oqmUeSHuJkkVMY2g3Ty8Q2l7qGaymtTzwePdAUC2A8eFmTbHMXlG EJcQok1J2RfFnoVJUfON7dUKPu7rSrWpQhfB9aYGO93VROfZL5v4C29Hfx5g7QFwPFok dMZA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d12si23483828ilg.4.2021.08.10.13.50.03; Tue, 10 Aug 2021 13:50:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233376AbhHJUsu (ORCPT + 99 others); Tue, 10 Aug 2021 16:48:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:44252 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230295AbhHJUsr (ORCPT ); Tue, 10 Aug 2021 16:48:47 -0400 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (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 4A7FE61076; Tue, 10 Aug 2021 20:48:25 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.94.2) (envelope-from ) id 1mDYfg-003hA3-1Q; Tue, 10 Aug 2021 16:48:24 -0400 From: Steven Rostedt To: linux-trace-devel@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Tom Zanussi , Daniel Bristot de Oliveira , Masami Hiramatsu , Namhyung Kim , linux-rt-users , Clark Williams , "Steven Rostedt (VMware)" Subject: [PATCH 0/9] libtracefs: APIs to read a trace event hist file Date: Tue, 10 Aug 2021 16:48:09 -0400 Message-Id: <20210810204818.880714-1-rostedt@goodmis.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Steven Rostedt (VMware)" The hist trigger for trace events will create a histogram that can be read in the trace event's hist file. The file is human readable ASCII format, but that makes it difficult to process in programs. The tracefs_hist_data*() functions convert the histogram ASCII format into structures that can be processed and converted into tables. This patch series creates an API to read and parse this data into machine code readable structures that can then be processed. There's a working program in the man page. I found the parsing of the hist file to be somewhat trivial where I only needed to implement flex to do most of the work and was able to avoid using bison. That said, there are still some histograms that can fail to parse. Namely, if any key has a comma (,) or a colon (:) in it. This includes exec names if there's a program name with a comma or colon. This can be fixed with a bit more clever tricks with the lexer, but I'll add those if this becomes an issue. This series is also in my personal github account here: https://github.com/rostedt/libtracefs/tree/read-hist Steven Rostedt (VMware) (9): tracefs: Add API tracefs_hist_data_parse() libtracefs: Parse comment for hist data information libtracefs: Change hist_data_key type to flags libtracefs: Add API tracefs_hist_data_read() libtracefs: Add API tracefs_list_dup() libtracefs: Add APIs tracefs_hist_data_keys/value_names() libtracefs: Add API tracefs_hist_data_keys/values() and next_bucket() libtracefs: Have tracefs_hist_bucket_key flags save the type libtracefs: Add man pages for tracefs_hist_data functions Documentation/libtracefs-hist-data-2.txt | 346 +++++++ Documentation/libtracefs-hist-data.txt | 294 ++++++ include/tracefs.h | 54 + src/Makefile | 7 + src/tracefs-hist-data.c | 1175 ++++++++++++++++++++++ src/tracefs-utils.c | 26 + 6 files changed, 1902 insertions(+) create mode 100644 Documentation/libtracefs-hist-data-2.txt create mode 100644 Documentation/libtracefs-hist-data.txt create mode 100644 src/tracefs-hist-data.c -- 2.30.2