From owner-freebsd-questions@freebsd.org Tue Jan 12 21:02:27 2016 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26B8BA8040A for ; Tue, 12 Jan 2016 21:02:27 +0000 (UTC) (envelope-from darwinsurvivor@gmail.com) Received: from mail-pa0-x234.google.com (mail-pa0-x234.google.com [IPv6:2607:f8b0:400e:c03::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ED4B315D8 for ; Tue, 12 Jan 2016 21:02:26 +0000 (UTC) (envelope-from darwinsurvivor@gmail.com) Received: by mail-pa0-x234.google.com with SMTP id uo6so329226408pac.1 for ; Tue, 12 Jan 2016 13:02:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=xO9EBHUv7SeCb2pVbkgCwAz08HixKwvEWI/STLGocuc=; b=cVJJE3DA9RfLbL7z2rzQikmjYixoAmzWp7uaEiPSnQjMCNISd0nP22HrPTkRbZxTFo Kr+8qMWHAZTb4vxiTbNf2H6qDhXxfSDjzVGc4qNIBhL/rPGXJiKlm0D2QelNOuFo8rY5 jAxEzRmZ9J+KIfpyNi4wCoVxoFYiW3Jw6BPaydev2noXw24w8W8/GE9wMXQuyDxMTebU aRMpm10j543Ye0m4VaSGti+qoKEVeC/+h3cRVX0tJTM+4pot7RCATuukLIjNENWdJAXV 1/jDFXwS0HKhit9S/0gK03Focvl81KkMxgEj67xS2qGD4L3RNWaD1ttp483RmElqHHbt DXoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=xO9EBHUv7SeCb2pVbkgCwAz08HixKwvEWI/STLGocuc=; b=AVddSCt02EwuxY/gK8GU8Piebt7AM1bm79HzBDHM4DUDwfIHPwcjZn1KMkwYC7AP2y 5xc/cba0zEP3vN92+ZFoyHPv0AiQvOPKXlTAc2j0VdEbjuqgNtOAeaQuW0sxeqvNc7ha oJhdxBAZUWKdveAt2xG5bDXikxFuWjhau8RQnKCoc//oy/enb78G6U1A4ojYU1lZs9a3 kN07h3G3P8GEpIBTroAkhaEqrDbYzb/LsSD7a8Z7AQ9tNWJaTAVnurhzb+RdKB67RjRP /XzJBjrLbI7ONz3gF1IfsoR5fumBxa1kKidydCkPkKidiQWbfNsxf1d5nMtNem4/ibLY jI2A== X-Gm-Message-State: ALoCoQmbXybbryLy1mE3pYPD7OZIIt+2p2qRxNxiHwaI1k3oGlBnAv9DO8qzr5f1RmWx5gx942nXF73yOguLwGIjbJt6MqzjBw== MIME-Version: 1.0 X-Received: by 10.66.255.97 with SMTP id ap1mr56779871pad.135.1452632546625; Tue, 12 Jan 2016 13:02:26 -0800 (PST) Received: by 10.66.67.17 with HTTP; Tue, 12 Jan 2016 13:02:26 -0800 (PST) In-Reply-To: <20160113052558.R93547@sola.nimnet.asn.au> References: <20160111002439.Q93547@sola.nimnet.asn.au> <56928802.2040802@hiwaay.net> <20160111154616.G93547@sola.nimnet.asn.au> <20160111203832.GC88498@neutralgood.org> <20160113052558.R93547@sola.nimnet.asn.au> Date: Tue, 12 Jan 2016 13:02:26 -0800 Message-ID: Subject: Re: Task to busy one CPU 100% for a period of time? From: "darwinsurvivor@gmail.com" To: Ian Smith Cc: kpneal@pobox.com, "William A. Mahaffey III" , freebsd-questions@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 21:02:27 -0000 Have you looked at the sysutils/stress utility? It may do what you need. ~Doug On Tue, Jan 12, 2016 at 10:36 AM, Ian Smith wrote: > On Mon, 11 Jan 2016 15:38:32 -0500, kpneal@pobox.com wrote: > > On Mon, Jan 11, 2016 at 04:04:05PM +1100, Ian Smith wrote: > > > Thanks for your response. However I don't do C, and really need to > find > > > something out of the box that I can configure to run at 100% of one > CPU > > > for a specified number of iterations, which will then run for a > certain > > > amount of CPU time on my hardware, while always on the run queue. > > > > Won't this reproduce your results? > > > > Two compilations: > > > > /* main.c */ > > int main() { > > for (;;) > > dummy_function(); > > /*NOTREACHED*/ > > return(0); > > } > > > > /* dummy.c */ > > int dummy_function(void) { > > return 0; > > } > > > > cc -c main.c > > cc -c dummy.c > > cc -o load1 main.o dummy.o > > > > One invocation of this program should consume an entire CPU and > therefore > > raise the load average by 1.00. Run as many as you like. > > > > (The reason for the two compilations is to avoid having any compiler > > optimize away the for loop. Just to be safe.) > > Thankyou Kevin. Works a treat, so far tested 8 at once, loadavg = 8.00 > > I'll follow up hopefully tomorrow with results of a sh script to run a > given number of instances for a given time, needing a bit more testing. > > cheers, Ian > _______________________________________________ > freebsd-questions@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to " > freebsd-questions-unsubscribe@freebsd.org" >