From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030279AbXCMMMm (ORCPT ); Tue, 13 Mar 2007 08:12:42 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S965711AbXCMMMm (ORCPT ); Tue, 13 Mar 2007 08:12:42 -0400 Received: from outpipe-village-512-1.bc.nu ([81.2.110.250]:50390 "EHLO lxorguk.ukuu.org.uk" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S965702AbXCMMMl (ORCPT ); Tue, 13 Mar 2007 08:12:41 -0400 Date: Tue, 13 Mar 2007 13:15:33 +0000 From: Alan Cox To: "Michael K. Edwards" Cc: "Bodo Eggert" <7eggert@gmx.de>, "Eric Dumazet" , "Linux Kernel Mailing List" Subject: Re: sys_write() racy for multi-threaded append? Message-ID: <20070313131533.1ec468c3@lxorguk.ukuu.org.uk> In-Reply-To: References: <7WzUo-1zl-21@gated-at.bofh.it> <7WAx2-2pg-21@gated-at.bofh.it> <7WAGF-2Bx-9@gated-at.bofh.it> <7WB07-3g5-33@gated-at.bofh.it> <7WBt7-3SZ-23@gated-at.bofh.it> <20070313022430.57503b08@lxorguk.ukuu.org.uk> X-Mailer: Claws Mail 2.8.1 (GTK+ 2.10.8; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org > But on that note -- do you have any idea how one might get ltrace to > work on a multi-threaded program, or how one might enhance it to > instrument function calls from one shared library to another? Or I don't know a vast amount about ARM ELF user space so no. > better yet, can you advise me on how to induce gdbserver to stream > traces of library/syscall entry/exits for all the threads in a > process? And then how to cram it down into the kernel so I don't take One way to do this is to use kprobes which will do exactly what you want as it builds a kernel module. Doesn't currently run on ARM afaik. > the hit for an MMU context switch every time I hit a syscall or Not easily with gdbstubs as you've got to talk to something to decide how to log the data and proceed. If you stick it kernel side its a lot of ugly new code and easier to port kprobes over, if you do it remotely as gdbstubs intends it adds latencies and screws all your timings. gdbstubs is also not terribly SMP aware and for low level work its sometimes easier to have on gdb per processor if you can get your brain around it. Alan