From owner-freebsd-current@FreeBSD.ORG Fri Nov 19 14:51:41 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 709461065672; Fri, 19 Nov 2010 14:51:41 +0000 (UTC) (envelope-from dnebdal@gmail.com) Received: from mail-gx0-f182.google.com (mail-gx0-f182.google.com [209.85.161.182]) by mx1.freebsd.org (Postfix) with ESMTP id 180258FC08; Fri, 19 Nov 2010 14:51:40 +0000 (UTC) Received: by gxk22 with SMTP id 22so105349gxk.13 for ; Fri, 19 Nov 2010 06:51:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=4OAJo5VQWDdWCDTyhIKA0XkXYufKaB9XYWbFkQb0M5A=; b=xxFZqOM3Of1Bj4n6xygKv2vrteDO3wq+sPc5Af4grZG9oImSqxikqrl+g9N24+xnGK xewn+KB5wTL7tCM8uH6jNZ3QUUyDUu9RYH0WoZAVCiYIxwopHW0vP1AVGWMTRzxe5EnI vXWpNe+Ty4+3yW2LlbzG8OT5J3R/tV9s1i8Gg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=HV5p5PIlb+xrYCxdW2JE49jMSf0oXGebuEz5YxJtzKfg/XoNKNrp/FYFwb/tku0KyP thIjF313F8XPUUk7XPEpwj0R69ZopYO6pOIY/FfzRLD7IaoD+SemgoDF//iZdesUVWvB NtmjATgnEiE/pGiQ1tJssnZsn/ynGCxrhwK4I= MIME-Version: 1.0 Received: by 10.42.76.66 with SMTP id d2mr413305ick.219.1290178299717; Fri, 19 Nov 2010 06:51:39 -0800 (PST) Received: by 10.231.58.202 with HTTP; Fri, 19 Nov 2010 06:51:39 -0800 (PST) In-Reply-To: <4CE68C0B.1080007@freebsd.org> References: <4CE29718.2050508@freebsd.org> <4CE51CDA.6010202@freebsd.org> <4CE533DE.7010401@freebsd.org> <4CE68C0B.1080007@freebsd.org> Date: Fri, 19 Nov 2010 16:51:39 +0200 Message-ID: From: Daniel Nebdal To: freebsd-current@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-acpi@freebsd.org Subject: Re: aperf/mperf X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Fri, 19 Nov 2010 14:51:41 -0000 On Fri, Nov 19, 2010 at 4:39 PM, Andriy Gapon wrote: > > I am thinking about providing two APIs for this. > > 1. KPI > void cpu_get_a_m_perf(u_int cpu, uint64_t *aperf, uint64_t *mperf); > > 2. Userland > sysctl dev.cpu.N.aperf_mperf that returns two UQUAD values. > > But I am not sure where to put the code for both APIs. > Adding another device under cpu seems like an overkill. > > Ideas? > Thanks! No comment on where to put it, but one other detail: Since these are measures since last reset, you probably want a similar "cpu_zero_a_m_perf" call. As for how that interacts with the sysctl, uhm ... maybe also offering a time-since-last-reset could be useful? -- Daniel Nebdal