From owner-freebsd-drivers@freebsd.org Thu Sep 12 08:53:28 2019 Return-Path: Delivered-To: freebsd-drivers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5C0CCEFE49; Thu, 12 Sep 2019 08:53:28 +0000 (UTC) (envelope-from shreyankfbsd@gmail.com) Received: from mail-yw1-xc35.google.com (mail-yw1-xc35.google.com [IPv6:2607:f8b0:4864:20::c35]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46TXc73lfzz40f5; Thu, 12 Sep 2019 08:53:27 +0000 (UTC) (envelope-from shreyankfbsd@gmail.com) Received: by mail-yw1-xc35.google.com with SMTP id u187so8848457ywa.11; Thu, 12 Sep 2019 01:53:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=z49Wpsc+LlT1jzd6f69xdxnUZKkwxKbi2sCCm82dpz0=; b=LCiihPYIThjXIl3PLi/Nzj2CyIpiRD3qkpDRbA0D0Y5tJ/mzJC/c3RgZ+9gPlUMc8o KY/hRO+rpJ51R6GTPmdkHs5G0ay5VzFMbDqBFXSo+hHzNOPLaXrQOykIz2YqgF/kMal1 9KMErO4xXyLBgAM+aWlAqrfGxCPrVSX1gspJmhI79iE+ruObW04tDhmRsjly2JlX0qTU 0FLird1BJl87gagdIgCUPRnvopsJdQ8Rmv8IzAJ+1O+97zlyTySuau44e9voMWGQuv9S 0Qn7vVhOvkzZEM98dMBR6khQ7/KIxWNgEtzDQsxRQR751V9ObUbYGIfuKBvqTPlBvD1X DKLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=z49Wpsc+LlT1jzd6f69xdxnUZKkwxKbi2sCCm82dpz0=; b=GTXdVDgguR2H8CqLegfKpaLqhfg3/F62ylbsyWVb8nukeXA2lyRjFtVRjy8bUNktNd n194hu+lsG5m1FfTxXUjlxdHE8uBLwYJyDQ2CEM4A6safg/qk1QOVLCvYcv6M6CQSSKi Sq+1fW6p/VHKqBV0mxKx1mFp33x2oW17BXlMsYISW5r125MH5516hvdy9oo2ySA6VcHA DVvxPl9xjEDfrpBgXPXyNgzcYX/zQL4LOK82rkoIx2MQVfpaN5ZyoRojREkZaIsxSADL 5LPYQTcBTtU17XxZ0/8WcgMRJfEWibMoGo7d8dNUtjx4Vxut8af+pacnZt9Lw5t82mOa HRIA== X-Gm-Message-State: APjAAAWdeBH5/adhirCKYKCie3uwfSu8tyjJNyjzBNNXiSNfeZcbVjuP /tivSTgfREBrEf8VBfjzrnRseIgWX8Q3FR9J3Wax X-Google-Smtp-Source: APXvYqzxbm1AaYenvXclJeL4QaNnL4XJdBVP/2zslAhaftzMAWptFpTLQXQTDT2oPB0xp6UKw7GbPqODktGHmeaz/B8= X-Received: by 2002:a81:108f:: with SMTP id 137mr25958352ywq.324.1568278406209; Thu, 12 Sep 2019 01:53:26 -0700 (PDT) MIME-Version: 1.0 References: <0534e1a9-af57-96cf-9ea2-ec4b30021226@gmail.com> In-Reply-To: <0534e1a9-af57-96cf-9ea2-ec4b30021226@gmail.com> From: shreyank amartya Date: Thu, 12 Sep 2019 14:23:14 +0530 Message-ID: Subject: Re: hwpmc ktrdump: failed to resolve ktr symbols To: Navdeep Parhar Cc: freebsd-drivers@freebsd.org, freebsd-hackers@freebsd.org X-Rspamd-Queue-Id: 46TXc73lfzz40f5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=LCiihPYI; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of shreyankfbsd@gmail.com designates 2607:f8b0:4864:20::c35 as permitted sender) smtp.mailfrom=shreyankfbsd@gmail.com X-Spamd-Result: default: False [-3.00 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; IP_SCORE(0.00)[ip: (-8.67), ipnet: 2607:f8b0::/32(-2.72), asn: 15169(-2.25), country: US(-0.05)]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_DN_SOME(0.00)[]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[5.3.c.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Sep 2019 08:53:28 -0000 Thanks, yes it seems I was missing both those options (KTR and DDB) in my kernel config. Now, I have a module (hwpmc) from which I intend to collect traces. However, when I build and load it, I don't see any ktraces when using it. But if I install it and load the module on boot, ktraces appear. Why does that happen? Anyway around that? Thanks Shreyank On Fri, Aug 30, 2019 at 9:37 PM Navdeep Parhar wrote: > On 2019-08-30 03:54, shreyank amartya wrote: > > Hi, > > > > I'm trying to collect traces from hwpmc module. I compiled the module > with > > -DHWPMC_DEBUG option and set the sysctl kern.hwpmc.debugflags but I'm > > unable to retrive the traces using ktrdump. I get this error message: > > > > ktrdump: failed to resolve ktr symbols > > > > I'm guessing that this error occurs because the symbols for hwpmc module > > (compiled and loaded separately) are not a part of kernel. If this is the > > case, then how do I get those symbols. In the ktr man page its also > > mentioned that ddb and gdb can retrieve ktraces. > > > > I found the ddb command show ktr. But how do I invoke ddb (without a > panic)? > > sysctl debug.kdb.enter=1 > > > > > I'm unable to find how can I use gdb to view the traces (I launched kgdb > > but could not find a command to show kernel traces). > > > > Any idea on how to get ktrdump working? Or get the kernel traces. > > You need a kernel with KTR support. See ktr(4) for a full list of > the options and other details. See "sysctl kern.conftxt" for what's > in your running kernel. > > Regards, > Navdeep >