From owner-freebsd-hackers@FreeBSD.ORG Mon Sep 12 11:36:22 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 95C45106566C for ; Mon, 12 Sep 2011 11:36:22 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 2E7148FC0A for ; Mon, 12 Sep 2011 11:36:21 +0000 (UTC) Received: by wyh15 with SMTP id 15so4386665wyh.13 for ; Mon, 12 Sep 2011 04:36:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=xRX3YxSjVXfLfTUtkQUEzOvdMExZ+viFPMloQ8kmgLQ=; b=v74AnbC66BiZUEl5V0FHjDrr6Fj8QTdjQiT5m0YWdCbthigK2m09gElCSaLqunvsh0 S7fsZOSb1DQMJoSDmmyBkq0pw7jCboAwplX5NaC90cLJYt4g6XzYfSpLOI34UV4/5/Lu dWhX/ajDGte6Igq2y4fxkSuZCJ4yJdKPvAx4Q= MIME-Version: 1.0 Received: by 10.227.200.147 with SMTP id ew19mr78832wbb.38.1315827380981; Mon, 12 Sep 2011 04:36:20 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.227.19.193 with HTTP; Mon, 12 Sep 2011 04:36:20 -0700 (PDT) In-Reply-To: <20110912112703.GO17489@deviant.kiev.zoral.com.ua> References: <20110912094842.251380@gmx.net> <20110912112703.GO17489@deviant.kiev.zoral.com.ua> Date: Mon, 12 Sep 2011 13:36:20 +0200 X-Google-Sender-Auth: TH6HyemrD8REC55N-4VSxe6b44M Message-ID: From: Attilio Rao To: Kostik Belousov Content-Type: text/plain; charset=UTF-8 Cc: filippo.sironi@gmail.com, freebsd-hackers@freebsd.org, Marc L?rner Subject: Re: Re: Kernel timers infrastructure X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Sep 2011 11:36:22 -0000 Besides I'd also suggest to have the callout rearming as the very last step of you callback in order to avoid buffering interleaving issues. Attilio 2011/9/12 Kostik Belousov : > On Mon, Sep 12, 2011 at 11:48:42AM +0200, "Marc L?rner" wrote: >> Hello, >> what about changing order of callout_reset and uprintf? >> And your timeout isn't 1minute, it's one second! >> >> Regards, >> Marc >> >> >I already did that to ensure timer_event_handler would be called correctly. >> > >> >The result follows: >> > >> >freebsd# kldload ./timer.ko >> >timer_event_handler() with MOD_LOAD >> > >> >freebsd# kldunload ./timer.ko >> >timer_event_handler() with MOD_UNLOAD >> > >> >and I maintained the module load for about 1 minute so the timer printing >"Hello, World!" should have been run. >> > >> >Filippo >> > >> >On 12/set/2011, at 11:24, Adrian Chadd wrote: >> > >> >> How about adding some printfs() to the functions to ensure they're being called? >> >> > > The callouts are executed in the context that does not have the controlling > terminal. uprintf(9) tries to use the ctty for output. > > Use printf(9) to get something on console. > -- Peace can only be achieved by understanding - A. Einstein