From owner-freebsd-questions@freebsd.org Tue Feb 23 02:48:15 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 876F6AB1EAF for ; Tue, 23 Feb 2016 02:48:15 +0000 (UTC) (envelope-from philip@semanchuk.com) Received: from rickgrimes.asoshared.com (rickgrimes.asoshared.com [108.165.20.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6937C1379 for ; Tue, 23 Feb 2016 02:48:15 +0000 (UTC) (envelope-from philip@semanchuk.com) Received: from user-10lff6g.cable.mindspring.com ([65.87.188.208]:38358 helo=[10.0.1.5]) by rickgrimes.asoshared.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.86) (envelope-from ) id 1aY2Ii-0003Jp-1K for freebsd-questions@freebsd.org; Mon, 22 Feb 2016 21:02:08 -0500 From: Philip Semanchuk Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Adding printf() to observe semaphore behavior? Message-Id: <61DF564A-5DB5-4C9C-B12B-24CE529706D8@semanchuk.com> Date: Mon, 22 Feb 2016 21:01:46 -0500 To: freebsd-questions@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) X-Mailer: Apple Mail (2.2104) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - rickgrimes.asoshared.com X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - semanchuk.com X-Get-Message-Sender-Via: rickgrimes.asoshared.com: authenticated_id: philip@semanchuk.com X-Authenticated-Sender: rickgrimes.asoshared.com: philip@semanchuk.com X-Source: X-Source-Args: X-Source-Dir: 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, 23 Feb 2016 02:48:15 -0000 Hi all, I=E2=80=99m trying to debug a potential kernel problem with POSIX = semaphores. I=E2=80=99m trying to build a custom kernel with some added = printf() statements and I=E2=80=99m not seeing any output, neither to = /var/log/messages nor to the console. I would appreciate any help at = getting the kernel to talk to me.=20 Here=E2=80=99s what I=E2=80=99ve already done on my PC BSD 10.2 running = inside a VM =E2=80=94 =20 - Downloaded the source to /usr/src - Added a printf(=E2=80=9CHello world\n=E2=80=9D) in each implementation = of sem_open() (both in lib/libc/gen/sem.c and sem_new.c) and one inside = the implementation of ksem_open() (in sys/kern/uipc_sem.c) for good = measure. I did not #include which I=E2=80=99ve read is the = correct thing to do when one wants to use the kernel=E2=80=99s printf().=20= - cd /usr/src - sudo make buildkernel=20 - sudo make installkernel - reboot - Create a POSIX semaphore. It works, but I don=E2=80=99t see my = =E2=80=9CHello world=E2=80=9D message. Any suggestions on what I=E2=80=99m doing wrong would be appreciated. Thanks Philip