Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp1174057pxy; Sun, 1 Aug 2021 15:35:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzqlAiN97tYn203St+7R04vYQ/taR8ewgTwdgODAcwWwHh6/i5wUqFX9W2/DfbiivcReC24 X-Received: by 2002:aa7:cd96:: with SMTP id x22mr16229885edv.102.1627857347512; Sun, 01 Aug 2021 15:35:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627857347; cv=none; d=google.com; s=arc-20160816; b=I11Vj2VyHZEVh0oYzW+M0tAWDAr4s9Ze76/Up5et6niBkjwmhbESLnPsmGDRaW/jF9 QV8ZKOU1nxq4CuPfxM7edxBMqcskk0KzAXowYmv45U66JPsa298OiOdVCVk8MVSU17UX dWw1L0E94tOqZIN/C1Mzofb6bxZ8//zkOtJGEOwlbwX0ZCbDXHLLq+mfDE7y/gdi8jwX 62/+KZ947COBJ4lZNyl2bOq5kC2RndJdOX8hVKexUlZGafp4XJ2zog+IFcAnbQKfIJ9B XV3LE52rhZgWV487WGYjdIxiX1834e/PspY1rxWarpZFffLxiSKOOsRTFcx7p/uRNHaG bXVg== 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 :references:in-reply-to:message-id:subject:cc:to:from:date; bh=Vw2RJj/ki3isEBYYvOKhbe85JZqGPP+S+UckEb7nxko=; b=l/CvCSPgmbvd6xki2j7IKKNYtTPc24TNST8kdyKEAH8XMOk0RP3ulNONTXWMZtkuYx Ai95IlWvLOmHSkvGHxFUpnPrHCvdRp/s8Qnr7u3y+5GD6IOfTnYWFrvlh2vceotFB6kM qZeQnjyOrY+lInJIRI9y+uQmosBcby5YhR8skmu41mfG4b5eqqvRMFS0cPnL2hMJaIfI eDf/eF8HduqI/nB2PFLPcH9+S+ke+1g6/XmJ0ZyCGf8Bkcom8V2nyL4Y5ENAGB4ODulr eXGsl2dyDf/Nq39t4BX2OfHXBkZivKg42T3pigxUWEhXYowOOANMjRRJ1xdbkAMufQ1V DyDA== 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 gz11si7963649ejb.158.2021.08.01.15.35.04; Sun, 01 Aug 2021 15:35:47 -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 S230280AbhHAW32 (ORCPT + 99 others); Sun, 1 Aug 2021 18:29:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:52984 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229759AbhHAW31 (ORCPT ); Sun, 1 Aug 2021 18:29:27 -0400 Received: from rorschach.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 1BB70603E7; Sun, 1 Aug 2021 22:29:18 +0000 (UTC) Date: Sun, 1 Aug 2021 18:29:16 -0400 From: Steven Rostedt To: "Ahmed S. Darwish" Cc: linux-trace-devel@vger.kernel.org, linux-kernel@vger.kernel.org, Tom Zanussi , Daniel Bristot de Oliveira , Masami Hiramatsu , Namhyung Kim , linux-rt-users , Clark Williams Subject: Re: [PATCH 17/17] libtracefs: Add man page for tracefs_sql() Message-ID: <20210801182916.689a84a8@rorschach.local.home> In-Reply-To: References: <20210730221824.595597-1-rostedt@goodmis.org> <20210730221824.595597-18-rostedt@goodmis.org> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 1 Aug 2021 15:39:25 +0200 "Ahmed S. Darwish" wrote: > On Fri, Jul 30, 2021, Steven Rostedt wrote: > > + > > +The SQL format is as follows: > > + > > +*SELECT* FROM JOIN ON WHERE > > + > > +Note, although the examples show the SQL commands in uppercase, they are not required to > > +be so. That is, you can use "SELECT" or "select" or "sElEct". > > + > > Maybe it would be helpful to mention that, unlike normal SELECT queries, > the JOIN and ON parts above are _not_ optional? > > That is, generic "one event source" queries: > > SELECT common_pid,msr,val FROM write_msr WHERE msr=72 > > are not supported. (I wish they were though ;-)) Actually, the sql parser should support it, but it will fail on the creation of events. That's because I started trying to make this create normal histograms. The problem is, that it can't really do a 1 to 1 on histograms and selects, so I gave up. But perhaps for the subset it can create, maybe I can still have it do so. That may require changing the API slightly. I'm not a big SQL person, so I don't know all the magic and I have no idea how to add the "values" part of the hist trigger. I could use SQL CAST to let people redefine the types that histograms allow, like: SELECT CAST(common_pid AS execname), CAST(id AS syscall) FROM sys_enter and have that produce: echo 'hist:keys=common_pid.execname,id.syscall' > events/raw_syscalls/sys_enter/trigger Any ideas for the syntax to get values? Or do people care about the value parameter any more than just "hitcount"? I don't think I have ever used it for anything. > > BTW, thanks a lot for this work. It will finally make synthetic events > usable! > Thanks! It's also something to make it easier for me to use. And hopefully, allow for even more complex synthetic events. -- Steve