From: Joe Perches <joe@perches.com> To: Venkateswara Naralasetty <quic_vnaralas@quicinc.com>, ath11k@lists.infradead.org Cc: linux-wireless@vger.kernel.org Subject: Re: [PATCH 1/2] ath11k: add dbring debug support Date: Thu, 09 Dec 2021 16:09:04 -0800 [thread overview] Message-ID: <4446ca5bf0a8120a37f89cdb0f50d898636630a2.camel@perches.com> (raw) In-Reply-To: <1636439522-14509-1-git-send-email-quic_vnaralas@quicinc.com> On Tue, 2021-11-09 at 12:02 +0530, Venkateswara Naralasetty wrote: > Target copies spectral report and CFR report through dbring to > host for further processing. This mechanism involves ring and > buffer management in the Host, FW, and uCode, where improper > tail pointer update issues are seen. > > This dbring debug support help to debug such issues by tracking > head and tail pointer movement along with the timestamp at which > each buffer is received and replenished. > @@ -1068,6 +1107,166 @@ static const struct file_operations fops_simulate_radar = { > .open = simple_open > }; > > +static ssize_t ath11k_dbr_dump_debug_entries(struct file *file, > + char __user *user_buf, > + size_t count, loff_t *ppos) > +{ > + struct ath11k_db_ring_debug *db_ring_debug = file->private_data; > + static const char * const event_id_to_string[] = {"empty", "Rx", "Replenish"}; > + int size = ATH11K_DBR_DEBUG_ENTRIES_MAX * 100; > + char *buf; > + int i, ret; > + int len = 0; > + > + buf = kzalloc(size, GFP_KERNEL); > + if (!buf) > + return -ENOMEM; > + > + len += scnprintf(buf + len, size - len, "------------------------------------\n"); > + len += scnprintf(buf + len, size - len, "| idx | hp | tp | timestamp | event|\n"); > + len += scnprintf(buf + len, size - len, "------------------------------------\n"); > + > + spin_lock_bh(&db_ring_debug->lock); > + > + for (i = 0; i < db_ring_debug->num_ring_debug_entries; i++) { > + len += scnprintf(buf + len, size - len, > + "|%4u|%8u|%8u|%11llu|%8s|\n", i, > + db_ring_debug->entries[i].hp, > + db_ring_debug->entries[i].tp, > + db_ring_debug->entries[i].timestamp, > + event_id_to_string[db_ring_debug->entries[i].event]); > + } I think this would look a lot nicer column aligned along the | boundaries len += scnprintf(buf + len, size - len, "--------------------------------------------------------\n"); len += scnprintf(buf + len, size - len, "| idx | hp | tp | timestamp | event |\n"); len += scnprintf(buf + len, size - len, "--------------------------------------------------------\n"); spin_lock_bh(&db_ring_debug->lock); for (i = 0; i < db_ring_debug->num_ring_debug_entries; i++) { len += scnprintf(buf + len, size - len, "| %4u | %8u | %8u | %11llu | %-9s |\n", i, db_ring_debug->entries[i].hp, db_ring_debug->entries[i].tp, db_ring_debug->entries[i].timestamp, event_id_to_string[db_ring_debug->entries[i].event]);
WARNING: multiple messages have this Message-ID (diff)
From: Joe Perches <joe@perches.com> To: Venkateswara Naralasetty <quic_vnaralas@quicinc.com>, ath11k@lists.infradead.org Cc: linux-wireless@vger.kernel.org Subject: Re: [PATCH 1/2] ath11k: add dbring debug support Date: Thu, 09 Dec 2021 16:09:04 -0800 [thread overview] Message-ID: <4446ca5bf0a8120a37f89cdb0f50d898636630a2.camel@perches.com> (raw) In-Reply-To: <1636439522-14509-1-git-send-email-quic_vnaralas@quicinc.com> On Tue, 2021-11-09 at 12:02 +0530, Venkateswara Naralasetty wrote: > Target copies spectral report and CFR report through dbring to > host for further processing. This mechanism involves ring and > buffer management in the Host, FW, and uCode, where improper > tail pointer update issues are seen. > > This dbring debug support help to debug such issues by tracking > head and tail pointer movement along with the timestamp at which > each buffer is received and replenished. > @@ -1068,6 +1107,166 @@ static const struct file_operations fops_simulate_radar = { > .open = simple_open > }; > > +static ssize_t ath11k_dbr_dump_debug_entries(struct file *file, > + char __user *user_buf, > + size_t count, loff_t *ppos) > +{ > + struct ath11k_db_ring_debug *db_ring_debug = file->private_data; > + static const char * const event_id_to_string[] = {"empty", "Rx", "Replenish"}; > + int size = ATH11K_DBR_DEBUG_ENTRIES_MAX * 100; > + char *buf; > + int i, ret; > + int len = 0; > + > + buf = kzalloc(size, GFP_KERNEL); > + if (!buf) > + return -ENOMEM; > + > + len += scnprintf(buf + len, size - len, "------------------------------------\n"); > + len += scnprintf(buf + len, size - len, "| idx | hp | tp | timestamp | event|\n"); > + len += scnprintf(buf + len, size - len, "------------------------------------\n"); > + > + spin_lock_bh(&db_ring_debug->lock); > + > + for (i = 0; i < db_ring_debug->num_ring_debug_entries; i++) { > + len += scnprintf(buf + len, size - len, > + "|%4u|%8u|%8u|%11llu|%8s|\n", i, > + db_ring_debug->entries[i].hp, > + db_ring_debug->entries[i].tp, > + db_ring_debug->entries[i].timestamp, > + event_id_to_string[db_ring_debug->entries[i].event]); > + } I think this would look a lot nicer column aligned along the | boundaries len += scnprintf(buf + len, size - len, "--------------------------------------------------------\n"); len += scnprintf(buf + len, size - len, "| idx | hp | tp | timestamp | event |\n"); len += scnprintf(buf + len, size - len, "--------------------------------------------------------\n"); spin_lock_bh(&db_ring_debug->lock); for (i = 0; i < db_ring_debug->num_ring_debug_entries; i++) { len += scnprintf(buf + len, size - len, "| %4u | %8u | %8u | %11llu | %-9s |\n", i, db_ring_debug->entries[i].hp, db_ring_debug->entries[i].tp, db_ring_debug->entries[i].timestamp, event_id_to_string[db_ring_debug->entries[i].event]); -- ath11k mailing list ath11k@lists.infradead.org http://lists.infradead.org/mailman/listinfo/ath11k
next prev parent reply other threads:[~2021-12-10 0:09 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-11-09 6:32 [PATCH 1/2] ath11k: add dbring debug support Venkateswara Naralasetty 2021-11-09 6:32 ` Venkateswara Naralasetty 2021-11-09 6:32 ` [PATCH 2/2] ath11k: add spectral/CFR buffer validation support Venkateswara Naralasetty 2021-11-09 6:32 ` Venkateswara Naralasetty 2021-11-17 9:00 ` [PATCH 1/2] ath11k: add dbring debug support Kalle Valo 2021-11-17 9:00 ` Kalle Valo 2021-12-10 0:09 ` Joe Perches [this message] 2021-12-10 0:09 ` Joe Perches
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=4446ca5bf0a8120a37f89cdb0f50d898636630a2.camel@perches.com \ --to=joe@perches.com \ --cc=ath11k@lists.infradead.org \ --cc=linux-wireless@vger.kernel.org \ --cc=quic_vnaralas@quicinc.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.