From patchwork Thu Aug 21 10:57:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siddhesh Poyarekar X-Patchwork-Id: 381907 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 27B3D140081 for ; Thu, 21 Aug 2014 20:58:41 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=Fkh3789hAWoUPo6nw07cRKW7aab2jPJ qYJTGeKoQqmrDLwXeT0+krhYxT5TDVPmez5hAVl8c6N2BOZ4WF6ZeQxgG7ZSc+Hm G8Cfm9yeQys0+Jgi2m6sq1xJajDEwe/GF19kNFVNL2ESf2vzhjoCbzjxgjLzSh+D b4ilc3T9bG0E= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; s=default; bh=pTJAaxx5+LyUhx2iRH2fOMPbe9o=; b=jVoHo ueXQM+nO3dj+0yNnPVqmQknwu3ORlnRGnKjRe3QfEPH2yLail3slSa2rNnlLdKjG 9U3RYben+Y+dRthCJ/RYtuzid+VI9MuJNhMHbBjoG0FGMnUFZ4v3iFieGSX6W2sT gEt5SlTqsH2YXKMgkL4sBfl7MfmaUu9RtXIn4Y= Received: (qmail 16466 invoked by alias); 21 Aug 2014 10:58:16 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 16388 invoked by uid 89); 21 Aug 2014 10:58:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL, BAYES_50, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com From: Siddhesh Poyarekar To: libc-alpha@sourceware.org Cc: Siddhesh Poyarekar Subject: [PATCH 04/19] Use MODULE_NAME in stap-probe instead of IN_LIB Date: Thu, 21 Aug 2014 16:27:28 +0530 Message-Id: <1408618663-2281-5-git-send-email-siddhesh@redhat.com> In-Reply-To: <1408618663-2281-1-git-send-email-siddhesh@redhat.com> References: <1408618663-2281-1-git-send-email-siddhesh@redhat.com> Verified that the generated code is unchanged on x86_64. * scripts/gen-libc-modules.awk (END): Generate defines for MODULE_NAME. * include/stap-probe.h (LIBC_PROBE_1): Use MODULE_NAME instead of IN_LIB. (STAP_PROBE_ASM): Likewise. --- include/stap-probe.h | 6 +++--- scripts/gen-libc-modules.awk | 9 ++++++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/include/stap-probe.h b/include/stap-probe.h index 688646c..150fc1e 100644 --- a/include/stap-probe.h +++ b/include/stap-probe.h @@ -30,7 +30,7 @@ Systemtap's header defines the macros STAP_PROBE (provider, name) and STAP_PROBEn (provider, name, arg1, ..., argn). For "provider" we paste - in the IN_LIB name (libc, libpthread, etc.) automagically. + in MODULE_NAME (libc, libpthread, etc.) automagically. The format of the arg parameters is discussed here: @@ -53,7 +53,7 @@ # endif # define LIBC_PROBE(name, n, ...) \ - LIBC_PROBE_1 (IN_LIB, name, n, ## __VA_ARGS__) + LIBC_PROBE_1 (MODULE_NAME, name, n, ## __VA_ARGS__) # define LIBC_PROBE_1(lib, name, n, ...) \ STAP_PROBE##n (lib, name, ## __VA_ARGS__) @@ -61,7 +61,7 @@ # define STAP_PROBE0 STAP_PROBE # define LIBC_PROBE_ASM(name, template) \ - STAP_PROBE_ASM (IN_LIB, name, template) + STAP_PROBE_ASM (MODULE_NAME, name, template) # define LIBC_PROBE_ASM_OPERANDS STAP_PROBE_ASM_OPERANDS diff --git a/scripts/gen-libc-modules.awk b/scripts/gen-libc-modules.awk index d3382b6..1ae4af3 100644 --- a/scripts/gen-libc-modules.awk +++ b/scripts/gen-libc-modules.awk @@ -32,9 +32,16 @@ match (FILENAME, ".*soversions.i") { # Finally, print out the header file. END { - printf ("/* AUTOGENERATED BY gen-libc-modules.awk, DO NOT EDIT. */\n\n") + printf ("/* AUTOGENERATED BY gen-libc-modules.awk, DO NOT EDIT. */\n") i = 1 + print ("\n/* Allowed values for IN_MODULE. */") for (l in libs) { printf ("#define MODULE_%s %d\n", l, libs[l]) } + print ("\n/* Module names, used in stap-probe.h */") + for (l in libs) { + printf ("#if IN_MODULE == MODULE_%s\n", l) + printf ("# define MODULE_NAME %s\n", l) + printf ("#endif\n") + } }