From patchwork Thu Jul 26 01:57:33 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Lance Taylor X-Patchwork-Id: 173315 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]) by ozlabs.org (Postfix) with SMTP id DE3642C0087 for ; Thu, 26 Jul 2012 11:57:57 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1343872679; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: MIME-Version:Received:Received:Date:Message-ID:Subject:From:To: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=VTXtSWh RlluZlWYbQaD7U2FTXCg=; b=Kz6ivQ9sJqqkkyJkVRwSG93oXXGv24i1WFJtIoc c0VZW4puMDIxGwGWvphHG+M3b2N9JuLdnFy/aIR/o09QJYKQRI1lFrTGu7x2fAYh V62i9tNWUnHJ0TuAlWkNBuCmwE/LkifNcc4C0LbCaNUHpAO6QL0EUj3LDqHnI07l r6eU= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:X-Google-DKIM-Signature:Received:MIME-Version:Received:Received:Date:Message-ID:Subject:From:To:Content-Type:X-System-Of-Record:X-Gm-Message-State:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=czkh8CwtpSVMYI/u8W1+LeLKRQaBRHjTapNpf+Y5YbM6m0R+CeZ6NjMxWOcy7H XhoLDuPCTcaPpXGNlgTOR6RxTC5qQh/Qufdpknu7RvpPWpHvhm7or90G3mWsLA4q R2pjGusyPfcSzy8KYJHKC/Uls3J65wp3oN5NYbAmwH0mU=; Received: (qmail 22702 invoked by alias); 26 Jul 2012 01:57:51 -0000 Received: (qmail 22521 invoked by uid 22791); 26 Jul 2012 01:57:49 -0000 X-SWARE-Spam-Status: No, hits=-4.6 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, KHOP_RCVD_TRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-pb0-f47.google.com (HELO mail-pb0-f47.google.com) (209.85.160.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 26 Jul 2012 01:57:34 +0000 Received: by pbbrq2 with SMTP id rq2so2384390pbb.20 for ; Wed, 25 Jul 2012 18:57:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type :x-system-of-record:x-gm-message-state; bh=HIi3CNFTux00eH2uwBDxh/2l54ksHQR8fN1WHwsX/HQ=; b=C2mM/8aDiPgXdEVU47JR8uE975roV4rR6SNx7uImgQNtepnQDVZOwxCkYS5A1kzwb3 xWuz28gqGYLRhXOQkPGLgQ57aX9AXU4hQq1a6c9/GCIdG9Pjg/eMm0hg3K+sYO6TtPyY rxlo1ry+L98py/X1QkeoAubw74jR4O7aYnHXbvwwLkEPvtYqVeg3qoY1SuExSdAIGRiU x33nUPp5X2rPS2/7l33j3PjbN2RZwKuPsVSOkoSrx46coC2nMzFkO7Dtc6VU5TrhC+it /4ireNjyOkPnJoaO0zMGt10RBDM+mGBLRXBW1L3oNd7syrUAidTSwt7YYzg1UA7aCOFx DE6w== Received: by 10.68.232.103 with SMTP id tn7mr858133pbc.86.1343267853770; Wed, 25 Jul 2012 18:57:33 -0700 (PDT) MIME-Version: 1.0 Received: by 10.68.232.103 with SMTP id tn7mr858123pbc.86.1343267853635; Wed, 25 Jul 2012 18:57:33 -0700 (PDT) Received: by 10.68.51.195 with HTTP; Wed, 25 Jul 2012 18:57:33 -0700 (PDT) Date: Wed, 25 Jul 2012 18:57:33 -0700 Message-ID: Subject: libgo patch committed: Fix runtime/pprof test From: Ian Lance Taylor To: gcc-patches , gofrontend-dev@googlegroups.com X-System-Of-Record: true X-Gm-Message-State: ALoCoQkU1niGpueXqwBGUcOG2Xx/q6ku09o9RUoHAGc8lmi64fIPA3KxvKXl74ObkT8RD4Nld43nzbOffRV75AX4dJzcFcRfZ+cP/EUwMZMYn4MhXk7lA/8TJEW2CbvLMxQoCAh25HK1sK27sUg1TfsRxTUvMuKN4SEuo+VbNpvP76c5BVUlnPx/hmyL1R4OUl6s89y5IjqG X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org This patch to libgo fixes the runtime/pprof test to pass, and enables it. it cleans up the runtime interface for profiling a little bit. Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu. Committed to mainline and 4.7 branch. Ian diff -r 55f2af449cde libgo/Makefile.am --- a/libgo/Makefile.am Sun Jul 22 20:56:08 2012 -0700 +++ b/libgo/Makefile.am Wed Jul 25 18:54:44 2012 -0700 @@ -1794,7 +1794,7 @@ # Check a package. CHECK = \ - GC="$(GOC) $(GOCFLAGS) -L `${PWD_COMMAND}` -L `${PWD_COMMAND}`/.libs"; \ + GC="$(GOC) $(GOCFLAGS) $($(subst /,_,$@)_GOCFLAGS) -L `${PWD_COMMAND}` -L `${PWD_COMMAND}`/.libs"; \ export GC; \ GOLIBS="$(MATH_LIBS) $(NET_LIBS)"; \ export GOLIBS; \ @@ -3012,6 +3012,9 @@ runtime/pprof/check: $(CHECK_DEPS) @$(CHECK) .PHONY: runtime/pprof/check +# At least for now, we need -static-libgo for this test, because +# otherwise we can't get the line numbers. +runtime_pprof_check_GOCFLAGS = -static-libgo @go_include@ sync/atomic.lo.dep sync/atomic.lo.dep: $(go_sync_atomic_files) @@ -3548,6 +3551,7 @@ os/user/check \ path/filepath/check \ regexp/syntax/check \ + runtime/pprof/check \ sync/atomic/check \ text/scanner/check \ text/tabwriter/check \ diff -r 55f2af449cde libgo/go/runtime/pprof/pprof_test.go --- a/libgo/go/runtime/pprof/pprof_test.go Sun Jul 22 20:56:08 2012 -0700 +++ b/libgo/go/runtime/pprof/pprof_test.go Wed Jul 25 18:54:44 2012 -0700 @@ -71,7 +71,8 @@ if f == nil { continue } - if strings.Contains(f.Name(), "ChecksumIEEE") { + if strings.Contains(f.Name(), "ChecksumIEEE") || + (strings.Contains(f.Name(), "update") && strings.Contains(f.Name(), "crc32")) { found = true } } diff -r 55f2af449cde libgo/runtime/go-signal.c --- a/libgo/runtime/go-signal.c Sun Jul 22 20:56:08 2012 -0700 +++ b/libgo/runtime/go-signal.c Wed Jul 25 18:54:44 2012 -0700 @@ -149,8 +149,7 @@ #ifdef SIGPROF if (sig == SIGPROF) { - /* FIXME. */ - runtime_sigprof (0, 0, nil, nil); + runtime_sigprof (); return; } #endif diff -r 55f2af449cde libgo/runtime/proc.c --- a/libgo/runtime/proc.c Sun Jul 22 20:56:08 2012 -0700 +++ b/libgo/runtime/proc.c Wed Jul 25 18:54:44 2012 -0700 @@ -1681,10 +1681,7 @@ // Called if we receive a SIGPROF signal. void -runtime_sigprof(uint8 *pc __attribute__ ((unused)), - uint8 *sp __attribute__ ((unused)), - uint8 *lr __attribute__ ((unused)), - G *gp __attribute__ ((unused))) +runtime_sigprof() { int32 n; diff -r 55f2af449cde libgo/runtime/runtime.h --- a/libgo/runtime/runtime.h Sun Jul 22 20:56:08 2012 -0700 +++ b/libgo/runtime/runtime.h Wed Jul 25 18:54:44 2012 -0700 @@ -451,7 +451,7 @@ int32 runtime_atoi(const byte*); uint32 runtime_fastrand1(void); -void runtime_sigprof(uint8 *pc, uint8 *sp, uint8 *lr, G *gp); +void runtime_sigprof(); void runtime_resetcpuprofiler(int32); void runtime_setcpuprofilerate(void(*)(uintptr*, int32), int32); void runtime_usleep(uint32);