NVDIMM Device and Persistent Memory development
 help / color / mirror / Atom feed
* [PATCH v4 26/34] tools/testing/nvdimm: Convert to printbuf
       [not found] <20220620004233.3805-1-kent.overstreet@gmail.com>
@ 2022-06-20  0:42 ` Kent Overstreet
  2022-06-24 19:32   ` Dan Williams
  0 siblings, 1 reply; 3+ messages in thread
From: Kent Overstreet @ 2022-06-20  0:42 UTC (permalink / raw)
  To: linux-kernel, linux-mm, pmladek
  Cc: Kent Overstreet, rostedt, enozhatsky, linux, willy, Dan Williams,
	Dave Hansen, nvdimm

This converts from seq_buf to printbuf. Here we're using printbuf with
an external buffer, meaning it's a direct conversion.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: nvdimm@lists.linux.dev
---
 tools/testing/nvdimm/test/ndtest.c | 22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)

diff --git a/tools/testing/nvdimm/test/ndtest.c b/tools/testing/nvdimm/test/ndtest.c
index 4d1a947367..a2097955da 100644
--- a/tools/testing/nvdimm/test/ndtest.c
+++ b/tools/testing/nvdimm/test/ndtest.c
@@ -12,7 +12,7 @@
 #include <linux/ndctl.h>
 #include <nd-core.h>
 #include <linux/printk.h>
-#include <linux/seq_buf.h>
+#include <linux/printbuf.h>
 
 #include "../watermark.h"
 #include "nfit_test.h"
@@ -740,32 +740,30 @@ static ssize_t flags_show(struct device *dev,
 {
 	struct nvdimm *nvdimm = to_nvdimm(dev);
 	struct ndtest_dimm *dimm = nvdimm_provider_data(nvdimm);
-	struct seq_buf s;
+	struct printbuf s = PRINTBUF_EXTERN(buf, PAGE_SIZE);
 	u64 flags;
 
 	flags = dimm->flags;
 
-	seq_buf_init(&s, buf, PAGE_SIZE);
 	if (flags & PAPR_PMEM_UNARMED_MASK)
-		seq_buf_printf(&s, "not_armed ");
+		prt_printf(&s, "not_armed ");
 
 	if (flags & PAPR_PMEM_BAD_SHUTDOWN_MASK)
-		seq_buf_printf(&s, "flush_fail ");
+		prt_printf(&s, "flush_fail ");
 
 	if (flags & PAPR_PMEM_BAD_RESTORE_MASK)
-		seq_buf_printf(&s, "restore_fail ");
+		prt_printf(&s, "restore_fail ");
 
 	if (flags & PAPR_PMEM_SAVE_MASK)
-		seq_buf_printf(&s, "save_fail ");
+		prt_printf(&s, "save_fail ");
 
 	if (flags & PAPR_PMEM_SMART_EVENT_MASK)
-		seq_buf_printf(&s, "smart_notify ");
+		prt_printf(&s, "smart_notify ");
 
+	if (printbuf_written(&s))
+		prt_printf(&s, "\n");
 
-	if (seq_buf_used(&s))
-		seq_buf_printf(&s, "\n");
-
-	return seq_buf_used(&s);
+	return printbuf_written(&s);
 }
 static DEVICE_ATTR_RO(flags);
 
-- 
2.36.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [PATCH v4 26/34] tools/testing/nvdimm: Convert to printbuf
  2022-06-20  0:42 ` [PATCH v4 26/34] tools/testing/nvdimm: Convert to printbuf Kent Overstreet
@ 2022-06-24 19:32   ` Dan Williams
       [not found]     ` <CA+n8AA-grcDuYWt-TxcttK+2tHpEP4s9ue2uq_0d8=hJpqNh+g@mail.gmail.com>
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Williams @ 2022-06-24 19:32 UTC (permalink / raw)
  To: Kent Overstreet, linux-kernel, linux-mm, pmladek
  Cc: Kent Overstreet, rostedt, enozhatsky, linux, willy, Dan Williams,
	Dave Hansen, nvdimm, santosh

[ add Santosh ]

Kent Overstreet wrote:
> This converts from seq_buf to printbuf. Here we're using printbuf with
> an external buffer, meaning it's a direct conversion.
> 
> Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
> Cc: Dan Williams <dan.j.williams@intel.com>
> Cc: Dave Hansen <dave.hansen@linux.intel.com>
> Cc: nvdimm@lists.linux.dev

Acked-by: Dan Williams <dan.j.williams@intel.com>

This probably also wants a Tested-by from Santosh, but it looks ok to me.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v4 26/34] tools/testing/nvdimm: Convert to printbuf
       [not found]     ` <CA+n8AA-grcDuYWt-TxcttK+2tHpEP4s9ue2uq_0d8=hJpqNh+g@mail.gmail.com>
@ 2022-07-01  6:32       ` Shivaprasad G Bhat
  0 siblings, 0 replies; 3+ messages in thread
From: Shivaprasad G Bhat @ 2022-07-01  6:32 UTC (permalink / raw)
  To: Santosh Sivaraj, Dan Williams
  Cc: Kent Overstreet, linux-kernel, linux-mm, Petr Mladek,
	Steven Rostedt, enozhatsky, Rasmus Villemoes, willy, Dave Hansen,
	Linux NVDIMM, Vaibhav Jain

On 6/25/22 05:12, Santosh Sivaraj wrote:
> I don't have setup to test this now. Adding Shiva and Vaibhav who could 
> probably help. Thanks, Santosh On Sat, 25 Jun, 2022, 1:03 am Dan 
> Williams, <dan.j.williams@intel.com> wrote: [ add Santosh ] Kent 
> Overstreet wrote: ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍
> ZjQcmQRYFpfptBannerStart
> This Message Is From an External Sender
> This message came from outside your organization.
> ZjQcmQRYFpfptBannerEnd
> I don't have setup to test this now. Adding Shiva and Vaibhav who could 
> probably help.
> 
> Thanks,
> Santosh
> 
> On Sat, 25 Jun, 2022, 1:03 am Dan Williams, <dan.j.williams@intel.com 
> <mailto:dan.j.williams@intel.com>> wrote:
> 
>     [ add Santosh ]
> 
>     Kent Overstreet wrote:
>      > This converts from seq_buf to printbuf. Here we're using printbuf
>     with
>      > an external buffer, meaning it's a direct conversion.
>      >
>      > Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com
>     <mailto:kent.overstreet@gmail.com>>
>      > Cc: Dan Williams <dan.j.williams@intel.com
>     <mailto:dan.j.williams@intel.com>>
>      > Cc: Dave Hansen <dave.hansen@linux.intel.com
>     <mailto:dave.hansen@linux.intel.com>>
>      > Cc: nvdimm@lists.linux.dev <mailto:nvdimm@lists.linux.dev>
> 
>     Acked-by: Dan Williams <dan.j.williams@intel.com
>     <mailto:dan.j.williams@intel.com>>
> 

The ndtest build requires [1] as the build is currently broken from 
nd_namespace_blk/blk_region infrastructure removal.

Dan, Could you review [1] and see if it can be included as well ?

With [1], the this patch is tested, and works fine.

Tested-By: Shivaprasad G Bhat <sbhat@linux.ibm.com>

References:
[1] 
https://patchwork.kernel.org/project/linux-nvdimm/patch/165025395730.2821159.14794984437851867426.stgit@lep8c.aus.stglabs.ibm.com/


>     This probably also wants a Tested-by from Santosh, but it looks ok
>     to me.
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-07-01  7:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20220620004233.3805-1-kent.overstreet@gmail.com>
2022-06-20  0:42 ` [PATCH v4 26/34] tools/testing/nvdimm: Convert to printbuf Kent Overstreet
2022-06-24 19:32   ` Dan Williams
     [not found]     ` <CA+n8AA-grcDuYWt-TxcttK+2tHpEP4s9ue2uq_0d8=hJpqNh+g@mail.gmail.com>
2022-07-01  6:32       ` Shivaprasad G Bhat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox