From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17979 invoked by alias); 22 May 2007 16:38:26 -0000 Received: (qmail 17950 invoked by uid 22791); 22 May 2007 16:38:20 -0000 X-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,DK_POLICY_SIGNSOME,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 22 May 2007 16:38:15 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.1/8.13.1) with ESMTP id l4MGcCqs025857; Tue, 22 May 2007 12:38:12 -0400 Received: from pobox.hsv.redhat.com (pobox.hsv.redhat.com [172.16.16.12]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l4MGcCQX023599; Tue, 22 May 2007 12:38:12 -0400 Received: from [10.32.4.106] (vpn-4-106.str.redhat.com [10.32.4.106]) by pobox.hsv.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id l4MGc8hS026646; Tue, 22 May 2007 12:38:09 -0400 Message-ID: <46531C6E.3010502@redhat.com> Date: Tue, 22 May 2007 16:38:00 -0000 From: David Smith User-Agent: Thunderbird 1.5.0.10 (X11/20070302) MIME-Version: 1.0 To: Mathieu Desnoyers CC: Systemtap List , ltt-dev@shafik.org Subject: Linux kernel marker questions Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2007-q2/txt/msg00359.txt.bz2 Mathieu, I've just finished checking in initial support for your new kernel markers into systemtap. I've got some rough edges to work on, but in general it works. As I implemented the marker support, I come up with several questions I'd like some help/clarification with. 1) According to Documentation/marker.txt, the marker name (subsystem_event) is "is an identifier unique to your event". Am I correct that unique marker names are not strictly enforced but "uniqueness" is more of a convention? _marker_set_probe() seems to support the view that marker names aren't unique since it doesn't stop looking for more marker matches once it finds a match. One problem this creates for systemtap is that systemtap's probe syntax looks like 'kernel.mark("marker_name")' and 'module("module_name").mark('marker_name'). I believe with the current code if a marker exists with the same name, format string, and flags in the kernel and a loadable module there isn't any way to only enable the marker in one place or the other - you can only enable both markers (assuming the module is loaded). Am I correct? 2) _marker_set_probe() expects the marker name, format string, and flags that were specified when the marker was inserted. If marker names were truly unique, I would really only need the marker name to enable a marker. Since systemtap can compile modules for a kernel that isn't running, I can't really use marker_list_probe() for getting a list of markers present (even if the output of marker_list_probe() was more than just printks). So, currently to get a list of markers for a particular kernel, the code reads and parses the kernel/module '__markers_strings' elf section, which gets systemtap the marker names and format strings. (Getting the marker flags out of a kernel/module elf file is possible, but won't be easy.) Currently systemtap can only enable markers that used the MF_DEFAULT set of flags. Have you got any ideas on how systemtap (or any other program) can get a list of all the data _marker_set_probe needs? 3) From systemtap's point of view, _marker_set_probe() doesn't return enough error information. Currently it just returns the number of probes enabled. If _marker_set_probe returns a 0 (meaning no markers were enabled), I don't know which of the following that means: - the marker name wasn't found - the marker name was found, but format string didn't match the compiled format string - the marker name was found and the format strings matched, but the marker flags didn't match the compiled marker flags - the marker is already enabled (since markers can only have one function attached to them at a time) Would there be any way of getting more detailed error information? Thanks for the help. -- David Smith dsmith@redhat.com Red Hat http://www.redhat.com 256.217.0141 (direct) 256.837.0057 (fax)