From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 51F78C43214 for ; Thu, 12 Aug 2021 15:50:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 331F06103E for ; Thu, 12 Aug 2021 15:50:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238335AbhHLPu5 (ORCPT ); Thu, 12 Aug 2021 11:50:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:46998 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232854AbhHLPu4 (ORCPT ); Thu, 12 Aug 2021 11:50:56 -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 62C1960F91; Thu, 12 Aug 2021 15:50:31 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.94.2) (envelope-from ) id 1mECyU-003thq-80; Thu, 12 Aug 2021 11:50:30 -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 , "Steven Rostedt (VMware)" Subject: [PATCH v2 0/2] libtracefs: Make hist variable names unique Date: Thu, 12 Aug 2021 11:50:27 -0400 Message-Id: <20210812155029.929048-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)" In order to be able to have API that can do onmax() and onchange() as well as include the .save() and .snapshot() actions, we need to make sure that the variable names are unique even between different events. The first adds a "randomness" to the name, and the second patch fixes an issue where the "end" event fields are saved in the same name as they are called, then the ".save" action can not be used on them. Changes since v1: - Use open coded "rand()" as rand() is not reentrant, and it we use our own seed each time. - Use gettimeofday() instead of time() as Yordan pointed out that time() has a resolution of 1 second, and a thread could call this for different synthetic events. Steven Rostedt (VMware) (2): libtracefs: Add random number to keep synthetic variables unique libtracefs: Have end event variables not be the end event field name src/tracefs-hist.c | 45 +++++++++++++++++++++++++++++++++++---------- 1 file changed, 35 insertions(+), 10 deletions(-) -- 2.30.2