From owner-freebsd-current@FreeBSD.ORG Tue Jan 27 06:36:37 2015 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E7A53991 for ; Tue, 27 Jan 2015 06:36:37 +0000 (UTC) Received: from mail-ie0-x22d.google.com (mail-ie0-x22d.google.com [IPv6:2607:f8b0:4001:c03::22d]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AD9D7756 for ; Tue, 27 Jan 2015 06:36:37 +0000 (UTC) Received: by mail-ie0-f173.google.com with SMTP id tr6so13411857ieb.4 for ; Mon, 26 Jan 2015 22:36:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=tF21zNQN4K2n1JmtbGkNUVdAGwJMVfP6rYCpHhQrfgo=; b=WutdBsWbUdOHEisWLUMpDLR/1Vw/8cYZovhV4BdYYAl+3UBfADZcp6Oj6r6cz2eWVa lGp1Vk4+dZsvJ1xBlRJnFFwRTGnjSW04M6C+iq/rUSEwMhPnO+WiYg7MYVWBaV4lSFaf 5JDSMHbYZJMGtiMTv/Ql0ICjmJ1WngS8nKkoHoNQ+UZMDatMQYWqyN3AzZe57zdufcgz cmN+4BwVrMFdEfZGSo/uBhP12Eef10EUSZ4g/ESkwuocQyvdEn8CeDYF8beU/MbeyqVy VKCgvpbgC+lT66Mzwb3NOeRI/gl8dq3485PKAKOtM2RKmgJ4AWtywyNjDVeVp48T5tBs /XeQ== MIME-Version: 1.0 X-Received: by 10.42.62.71 with SMTP id x7mr1038628ich.61.1422340596912; Mon, 26 Jan 2015 22:36:36 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.36.78.14 with HTTP; Mon, 26 Jan 2015 22:36:36 -0800 (PST) In-Reply-To: References: Date: Mon, 26 Jan 2015 22:36:36 -0800 X-Google-Sender-Auth: fn_ZlS76KGZwzqysR9Yx92U6wjU Message-ID: Subject: Re: Is anyone using the schedgraph.d script? From: Adrian Chadd To: Ryan Stone Content-Type: text/plain; charset=UTF-8 Cc: freebsd-current X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Jan 2015 06:36:38 -0000 On 26 January 2015 at 19:01, Ryan Stone wrote: > Hm, there was one bug in that script. I uploaded a fixed version. The fix was: > > - printf("%d %d KTRGRAPH group:\"thread\", id:\"%s/%s tid %d\", > state:\"runq add\", attributes: prio:%d, linkedto:\"%s/%s tid %d\"\n", > cpu, timestamp, args[0]->td_proc->p_comm, args[0]->td_name, > args[0]->td_tid, args[0]->td_priority, curthread->td_proc->p_comm, > curthread->td_name, args[0]->td_tid); > + printf("%d %d KTRGRAPH group:\"thread\", id:\"%s/%s tid %d\", > state:\"runq add\", attributes: prio:%d, linkedto:\"%s/%s tid %d\"\n", > cpu, timestamp, args[0]->td_proc->p_comm, args[0]->td_name, > args[0]->td_tid, args[0]->td_priority, curthread->td_proc->p_comm, > curthread->td_name, curthread->td_tid); > > Note that the last printf argument used args[0] instead of curthread > as intended. Cool! Thanks! > One other thing that I have noticed with the schedgraph data gathering > is that unlike KTR, in dtrace every CPU gathers its data into a > CPU-local buffer. This can mean that a CPU that sees a large number > of scheduler events will roll over its ring buffer much more quickly > than a lightly loaded CPU. This can lead to a confusing or misleading > schedgraph output at the beginning of the time period. You can > mitigate this problem by allowing dtrace to allocate a larger ring > buffer with: > > #pragma D option bufsize=32m > > (You can potentially tune it even higher than that, but that's a good > place to start) > > > Finally, I've noticed that schedgraph seems to have problems > auto-detecting the clock frequency, so I tend to forcifully specify > 1GHz (dtrace always outputs time in units of ns, so this is always > correct to do with dtrace-gather data) Good to know. Is there any reason why this isn't just checked into -HEAD and -10? -adrian