From patchwork Tue Apr 8 13:15:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Newton X-Patchwork-Id: 27977 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f200.google.com (mail-ob0-f200.google.com [209.85.214.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id EECA220553 for ; Tue, 8 Apr 2014 13:16:19 +0000 (UTC) Received: by mail-ob0-f200.google.com with SMTP id gq1sf3958466obb.7 for ; Tue, 08 Apr 2014 06:16:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:mailing-list :precedence:list-id:list-unsubscribe:list-subscribe:list-archive :list-post:list-help:sender:delivered-to:from:to:subject:date :message-id:x-original-sender:x-original-authentication-results; bh=oQJQBMlASRZndY4M1+bzPOpOWeK6LsvHUzvdUmFfzgo=; b=UxrzKyufetnjicRFqBfxIJzP2jnZ4yNpGKMNL7k+z4m/tGHMtGhy0OobYfaPrslTbY 9N2c3UgU6mz//qmhP9RTfvv2b6j5oeZUmMRMsYiYUTmCTKc0K0SN6C6gmR/ZMdpslkX7 rYkoRchZ+bPdsijeVNC6E2fm2pIeKSYo2ZL6cnjVUjQ2qXW65EFDfLkzfLBhEMzxV8kV ano+LyOL5L2yidAxDj0XZYfkk1fXuENzgYFKGblNatC7mhd/LiWYMKAIHNSnHq5VfxKf tlFbIOnuY5cRKELKn+CW1XruWR84vBz2+cfm409uQyCS7vp5Z5Uju6CDaw4P7ySw1UQd Plyg== X-Gm-Message-State: ALoCoQky6rCOOm8UOoyEXm9FtVuzxchJdBs+cjorUTfFfdpzLbNGsbwUT0WyyIH+Kt0A2Wk7nSr3 X-Received: by 10.43.4.4 with SMTP id oa4mr1542570icb.2.1396962978953; Tue, 08 Apr 2014 06:16:18 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.105.161 with SMTP id c30ls201198qgf.88.gmail; Tue, 08 Apr 2014 06:16:18 -0700 (PDT) X-Received: by 10.58.211.69 with SMTP id na5mr286847vec.30.1396962978801; Tue, 08 Apr 2014 06:16:18 -0700 (PDT) Received: from mail-vc0-x22d.google.com (mail-vc0-x22d.google.com [2607:f8b0:400c:c03::22d]) by mx.google.com with ESMTPS id q1si380502ves.171.2014.04.08.06.16.18 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 08 Apr 2014 06:16:18 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c03::22d is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c03::22d; Received: by mail-vc0-f173.google.com with SMTP id il7so723382vcb.18 for ; Tue, 08 Apr 2014 06:16:18 -0700 (PDT) X-Received: by 10.52.243.167 with SMTP id wz7mr96vdc.47.1396962978585; Tue, 08 Apr 2014 06:16:18 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.12.8 with SMTP id v8csp244689vcv; Tue, 8 Apr 2014 06:16:18 -0700 (PDT) X-Received: by 10.66.136.131 with SMTP id qa3mr4488016pab.77.1396962977824; Tue, 08 Apr 2014 06:16:17 -0700 (PDT) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id iw3si1061252pac.301.2014.04.08.06.16.17 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Apr 2014 06:16:17 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-48899-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 11178 invoked by alias); 8 Apr 2014 13:16:08 -0000 Mailing-List: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org Precedence: list 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 11161 invoked by uid 89); 8 Apr 2014 13:16:06 -0000 X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-we0-f174.google.com X-Received: by 10.180.98.67 with SMTP id eg3mr4556464wib.38.1396962962364; Tue, 08 Apr 2014 06:16:02 -0700 (PDT) From: Will Newton To: libc-alpha@sourceware.org Subject: [PATCH] aarch64: Add setjmp and longjmp SystemTap probes Date: Tue, 8 Apr 2014 14:15:56 +0100 Message-Id: <1396962956-28589-1-git-send-email-will.newton@linaro.org> X-Original-Sender: will.newton@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c03::22d is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=pass header.i=@sourceware.org X-Google-Group-Id: 836684582541 From: Venkataramanan Kumar Add setjmp, longjmp and longjmp_target Systemtap probes. ChangeLog: 2014-04-08 Will Newton Venkataramanan Kumar * sysdeps/aarch64/__longjmp.S: Include stap-probe.h. (__longjmp): Add longjmp and longjmp_target SystemTap probes. * sysdeps/aarch64/setjmp.S: Include stap-probe.h. (__sigsetjmp): Add setjmp SystemTap probe. --- sysdeps/aarch64/__longjmp.S | 10 ++++++++++ sysdeps/aarch64/setjmp.S | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/sysdeps/aarch64/__longjmp.S b/sysdeps/aarch64/__longjmp.S index 2d38bbf..1bb7be36 100644 --- a/sysdeps/aarch64/__longjmp.S +++ b/sysdeps/aarch64/__longjmp.S @@ -18,6 +18,7 @@ #include #include +#include /* __longjmp(jmpbuf, val) */ @@ -56,6 +57,10 @@ ENTRY (__longjmp) #else ldp x29, x30, [x0, #JB_X29<<3] #endif + /* longjmp probe takes 3 arguments, address of jump buffer as + first argument (8@x0), return value as second argument (-4@x1), + and target address (8@x30), respectively. */ + LIBC_PROBE (longjmp, 3, 8@x0, -4@x1, 8@x30) ldp d8, d9, [x0, #JB_D8<<3] ldp d10, d11, [x0, #JB_D10<<3] ldp d12, d13, [x0, #JB_D12<<3] @@ -98,6 +103,11 @@ ENTRY (__longjmp) ldr x5, [x0, #JB_SP<<3] #endif mov sp, x5 + + /* longjmp_target probe takes 3 arguments, address of jump buffer + as first argument (8@x0), return value as second argument (-4@x1), + and target address (8@x30), respectively. */ + LIBC_PROBE (longjmp_target, 3, 8@x0, -4@x1, 8@x30) cmp x1, #0 mov x0, #1 csel x0, x1, x0, ne diff --git a/sysdeps/aarch64/setjmp.S b/sysdeps/aarch64/setjmp.S index 5822abd..fd39319 100644 --- a/sysdeps/aarch64/setjmp.S +++ b/sysdeps/aarch64/setjmp.S @@ -18,6 +18,7 @@ #include #include +#include /* Keep traditional entry points in with sigsetjmp(). */ ENTRY (setjmp) @@ -46,6 +47,10 @@ ENTRY (__sigsetjmp) #else stp x29, x30, [x0, #JB_X29<<3] #endif + /* setjmp probe takes 3 arguments, address of jump buffer + first argument (8@x0), return value second argument (-4@x1), + and target address (8@x30), respectively. */ + LIBC_PROBE (setjmp, 3, 8@x0, -4@x1, 8@x30) stp d8, d9, [x0, #JB_D8<<3] stp d10, d11, [x0, #JB_D10<<3] stp d12, d13, [x0, #JB_D12<<3]