From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 78977 invoked by alias); 1 Apr 2016 13:36:55 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 78942 invoked by uid 89); 1 Apr 2016 13:36:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=She, she X-HELO: mail-pf0-f179.google.com Received: from mail-pf0-f179.google.com (HELO mail-pf0-f179.google.com) (209.85.192.179) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 01 Apr 2016 13:36:44 +0000 Received: by mail-pf0-f179.google.com with SMTP id n5so94542283pfn.2 for ; Fri, 01 Apr 2016 06:36:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=FE4zwb8wOdRCGLg2PYNOmJ49e8cr3p32AFPsFFenEOk=; b=iplB9MYsYtQe7qwAjGFozqIv+XGA4moRcxyUmd+wn17fv7Dvi3+vJVyQTJQlPjQhfh byavZmwsrjBAApInL/7AtG33nx9YrUljtvpOzFakpujv16cwR3AMZG2dq/vivTZ1Wqs9 NxX2+h+t3a4J6d/wBsrgcgx2XIo3T2dMB15ewt8bxs89lVF7m6VhFjjYw7i9dLMj61mo vCejMdiid86lz886PDWfXUSyplvbh6fpSWIfjL2QulXtPcOOSdxrRzfTd7q8Er4fbS+q +VyCNImeUZEzEE2EpqzB/9rVIIzwX4tCaACm9tOtJYmLpTFtdGq+qMUb8JgXS1Vr1jHO 5SQQ== X-Gm-Message-State: AD7BkJL43S0RhWrlB0t9kubnji4405jey4S/az44EHxYRG+oeTESzTxMN3yK7onsRPzR1w== X-Received: by 10.98.42.207 with SMTP id q198mr31179092pfq.103.1459517802249; Fri, 01 Apr 2016 06:36:42 -0700 (PDT) Received: from E107787-LIN (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id 62sm20904877pfk.83.2016.04.01.06.36.39 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Fri, 01 Apr 2016 06:36:41 -0700 (PDT) From: Yao Qi To: Simon Marchi Cc: Yao Qi , Subject: Re: [PATCH 2/2] Add test for fast tracepoint enable/disable References: <1459351018-23718-1-git-send-email-simon.marchi@ericsson.com> <1459351018-23718-2-git-send-email-simon.marchi@ericsson.com> <86k2kirk18.fsf@gmail.com> <56FD65EB.4040109@ericsson.com> Date: Fri, 01 Apr 2016 13:36:00 -0000 In-Reply-To: <56FD65EB.4040109@ericsson.com> (Simon Marchi's message of "Thu, 31 Mar 2016 14:01:15 -0400") Message-ID: <8637r5qwm5.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2016-04/txt/msg00005.txt.bz2 Simon Marchi writes: > Good question. Because the setup for testing fast tracepoints is > tedious, I always > use ftrace-lock.exp as a template, because it is relatively short. > ftrace-lock.exp > uses gdb_compile_pthreads. I think it makes sense, because the IPA > starts a helper > thread with pthread_create. gdb_compile_pthreads is used in ftrace-lock.exp because ftrace-lock.c is a multi-threaded program, but ftrace-enable-disable.c isn't. The program to be tested is running in one thread, and it doesn't have any interaction with the helper thread. > > Note that it still builds fine with gdb_compile instead of gdb_compile_pt= hreads, > probably because libinproctrace.so has a DT_NEEDED for libpthreads.so, > so it gets > pulled in. But using gdb_compile_pthreads should add -pthread to the > CFLAGS, which > may impact compilation (e.g. choose re-entrant versions of functions). Using IPA/fast tracepoint shouldn't affect how the program is compiled. User is writing and debugging a single thread program, and he/she wants to use fast tracepoint to debug. He/She shouldn't recompile the program with -lpthreads or -pthreads, what needed here is to let IPA be loaded with the program. > > However, I just noticed that the command line includes -lpthreads > instead of -pthreads: > > spawn gcc -Wl,--no-as-needed > /home/emaisin/build/binutils-gdb/gdb/testsuite/../../../../src/binutils-g= db/gdb/testsuite/gdb.trace/ftrace-enable-disable.c > \ > /home/emaisin/build/binutils-gdb/gdb/testsuite/../gdbserver/libinproctr= ace.so > -g \ > -lpthread -lm -o \ > /home/emaisin/build/binutils-gdb/gdb/testsuite/outputs/gdb.trace/ftrace= -enable-disable/ftrace-enable-disable > > I think that to be more "correct", we should try -pthread before -lpthrea= d in > gdb_compile_pthreads... I am not sure, it is a separate issue, this applies to all test cases compiled with gdb_compile_pthreads. --=20 Yao (=E9=BD=90=E5=B0=A7)