From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io0-x22e.google.com (mail-io0-x22e.google.com [IPv6:2607:f8b0:4001:c06::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 9E73F820FE for ; Tue, 14 Feb 2017 14:36:30 -0800 (PST) Received: by mail-io0-x22e.google.com with SMTP id j18so77214577ioe.2 for ; Tue, 14 Feb 2017 14:36:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=j5noGNxyNkMrEAr+I+QkWeF74heXZT3RCsHPao1RjHM=; b=R2BGjcnYJYDcwT9CKc5AFWSxcxcmBilSULA8SV4M1SDtxvvuhNyRd/u5ysjmR47Fvo +0b24r7jQhiZmSFt6TP+BrEoMP/y0WDsSgiqnZ+tirE/u1cajKBAFhJCba+xoKr34zwJ wOkuiKwynYS7s11dfdpA1/kCe50EqIA1bPOPv4LCFDuIqoXfdU5mndoPX4/DbvF5+0Xd rV3d0L7IhJbh6MSUAyBdR2HghODlbWWnBQFbx7YzX3sVj5AeedL93kt/ITklokQ0XtbU IILZQzR3chkzCKM9LRJ+BwVnTQ1cnoSKdUoBmLccu8NXaEX4nyva4ogat9qxZa7lILpI pv+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=j5noGNxyNkMrEAr+I+QkWeF74heXZT3RCsHPao1RjHM=; b=o3RwYnKEgt6yMK9DJGKgiP/bT+z2fGpBMRYblpn13lfV24uR8XI851cO6MtxHzqtpW RSmrETusjoswiwZzwU5PL+m8aQT9RLbGrUwkKMVSDvBUotel2QYyxA1RNqFh72n0QNJh wHXpZ6A0sf5z0klVqpcBOvEOTrRFPTedF+Ca9XmIZbYP+c13ghhspQorcZoKWTaTrqMD QCMxMaiDRThVVF1iVMS9NnKOstSSa4KIBTZgIxneScZLaga7sbjYji3qMFCXyucbzmJ0 6L+ft3cXWYSgZftsUftkwIzioiiUD2FDR3qA59/pjC34hHqmiULf6mxZkuYdeO2OzXa6 Nkaw== X-Gm-Message-State: AMke39nIJArHU4vH1kI0gYnMP26J5ZesBTOf2k8LDVebx/Jl7YJQ/BKN1ZvQY9vtakRuHhNjTOjdfMuCIX7LEw== X-Received: by 10.107.15.163 with SMTP id 35mr29028461iop.177.1487111789845; Tue, 14 Feb 2017 14:36:29 -0800 (PST) MIME-Version: 1.0 Received: by 10.64.241.204 with HTTP; Tue, 14 Feb 2017 14:36:29 -0800 (PST) In-Reply-To: <09003614-2953-3c06-2b7d-b0fdb81fd581@cmlab.biz> References: <485eda84-7d3c-cbcf-6dbe-bc302aa8e3c0@redhat.com> <09003614-2953-3c06-2b7d-b0fdb81fd581@cmlab.biz> From: Nikolay Bodunov Date: Wed, 15 Feb 2017 01:36:29 +0300 Message-ID: To: "David A. Van Arnem" Cc: "Kinney, Michael D" , "edk2-devel@ml01.01.org" , Laszlo Ersek X-Content-Filtered-By: Mailman/MimeDel 2.1.21 Subject: =?UTF-8?B?UmU6IERFQlVHKCkgbWFjcm9zIGluIERYRSBkcml2ZXI6IGNhbuKAmXQgbWFrZSBpdCB3b3JrIGluIFFFTVU=?= X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2017 22:36:30 -0000 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi I wrote "As a base". It's not my current code. I called "DEBUG() directly, without any conditions. Of course, code on given link won't call DEBUG() if no errors happen. I understand that UEFI Appliction should work fine with usual print functions, but now I want to know how to print debug message in DXE phase - at any way. Nikolay. 2017-02-15 1:17 GMT+03:00 David A. Van Arnem : > Hi, > > From a quick look at your code, I'm not sure you want to make a > DXE_DRIVER. The code looks more like a UEFI_APPLICATION. > CrScreenshotDxe.c should normally manage a device, for UEFI_DRIVERS it > will implement the Driver Binding Protocol functions Supported(), > Start(), and Stop(). > > Likely, the reason you aren't seeing any DEBUG() messages is because > your functions aren't being called. > > Regards, > David > > On 02/14/2017 03:06 PM, Nikolay Bodunov wrote: > > Thank you for the suggestions. > > > > I tried to use them: > > > >> (1) Please always terminate the debug message with a newline ("\n") > > Done. No changes. Of course, I usually do it, but in that case all I > needed > > was to have any string on output. Sorry for bad programming style. > > > >> (2) Please use DEBUG_ERROR as the symbolic constant for the error mask > > Done. I think you meant in DEBUG() macros. No changes. Question about > > style, too. > > > >> (3) DEBUG output from OVMF is by default not written to the serial por= t > > and > >> add -D DEBUG_ON_SERIAL_PORT > > Done. Recompiled OVMF with that option. I have now file "debug.log" 744= 15 > > bytes size that contains everything, include EFI Shell output, but exce= pt > > my debug messages > > > > BTW, QEMU option "-debugcon file:debug.log -global > > isa-debugcon.iobase=3D0x402", recommended in OVMF README, did nothing - > > "debug.log was empty. > > > > Based on results, I suppose that the problem is not on OVMF side. > > Hope you propose something else to try. Maybe I got something in a wron= g > > way. > > > > Nikolay > > > > 2017-02-14 21:28 GMT+03:00 Kinney, Michael D >: > > > >> If you prefer debug messages on a serial port, you can > >> add -D DEBUG_ON_SERIAL_PORT > >> > >> Mike > >> > >>> -----Original Message----- > >>> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf O= f > >> Laszlo Ersek > >>> Sent: Tuesday, February 14, 2017 10:17 AM > >>> To: Nikolay Bodunov ; > edk2-devel@ml01.01.org > >>> Subject: Re: [edk2] DEBUG() macros in DXE driver: can=E2=80=99t make = it work in > >> QEMU > >>> > >>> Hi Nikolay, > >>> > >>> On 02/14/17 18:55, Nikolay Bodunov wrote: > >>>> Hello > >>>> > >>>> > >>>> I compiled DXE Driver, in DEBUG_GCC49 mode, but I can=E2=80=99t prin= t any > debug > >>>> message. > >>>> DEBUG((-1, =E2=80=9CPrint test=E2=80=9D)) does nothing. Exactly as > >>>> DebugPrint(EFI_D_ERROR, =E2=80=9CPrint Test); > >>> > >>> (1) Please always terminate the debug message with a newline ("\n") > once > >>> you are done with it. (It's okay to format a single message with > several > >>> DEBUG calls of course, and terminate only the last DEBUG with a > newline.) > >>> > >>> (2) Please use DEBUG_ERROR as the symbolic constant for the error mas= k. > >>> > >>>> > >>>> However, I see =E2=80=9CPrint Test=E2=80=9D string in my *.efi binar= y. > >>>> I use QEMU + OMVF (OVMF was also recompliled in DEBUG_GCC49 mode, to > be > >>>> sure). Serial port output is redirected to a file: > >>>> qemu-system-x86_64 -L . --bios /=E2=80=A6/FV/OVMF.fd -hda hdd.img -s= erial > >>>> file:./serial_file > >>> > >>> (3) DEBUG output from OVMF is by default not written to the serial > port, > >>> it is written to the QEMU debug port. Please consult OvmfPkg/README f= or > >>> specifics, namely under "Capturing OVMF debug messages on qemu". > >>> > >>> Hope this helps, > >>> Laszlo > >>> > >>>> > >>>> All I see in output file is EFI shell output messages, include one > >> that my > >>>> driver was succesfully loaded. But no messages from DEBUG(). > >>>> > >>>> > >>>> My conditions: > >>>> > >>>> MODULE_TYPE =3D DXE_DRIVER > >>>> > >>>> > >>>> Debug Print Library: > >>>> > >>>> DebugLib|MdePkg/Library/BaseDebugLibSerialPort/ > >> BaseDebugLibSerialPort.inf > >>>> > >>>> (BaseDebugLibNull.inf is commented, of course) > >>>> > >>>> > >>>> DebugPrintEnabled() returns TRUE > >>>> > >>>> > >>>> I also tried to set some key options manually in MdeModulePkg.dsc > >>>> afterwards, but result didn=E2=80=99t change: > >>>> > >>>> > >>>> [Components] > >>>> > >>>> > >>>> MdeModulePkg/CrScreenshotDxe/CrScreenshotDxe.inf { > >>>> > >>>> > >>>> > >>>> > >>>> > >>>> gEfiMdePkgTokenSpaceGuid.gEfiMdePkgTokenSpaceGuid. > >> PcdDebugPrintErrorLevel|0x07 > >>>> > >>>> gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x2F > >>>> > >>>> gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80000042 > >>>> > >>>> > >>>> > >>>> > >>>> > >>>> > >>>> DebugLib|MdePkg/Library/BaseDebugLibSerialPort/ > >> BaseDebugLibSerialPort.inf > >>>> > >>>> > >>>> > >>>> > >>>> GCC:*_*_*_CC_FLAGS =3D -UMDEPKG_NDEBUG > >>>> > >>>> } > >>>> > >>>> > >>>> Code (I used it as a base): https://github.com/LongSoft/ > >> CrScreenshotDxe > >>>> > >>>> Where I got wrong and what else could I try to make it work? > >>>> > >>> > >>> _______________________________________________ > >>> edk2-devel mailing list > >>> edk2-devel@lists.01.org > >>> https://lists.01.org/mailman/listinfo/edk2-devel > >> > > > > > > > > -- > Regards, > David Van Arnem > Development Engineer IV > Computer Measurement Laboratory, LLC > > --=20 With best regards, Nikolay Bodunov