lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20141107141032.6dce6cf0@gandalf.local.home>
Date:	Fri, 7 Nov 2014 14:10:32 -0500
From:	Steven Rostedt <rostedt@...dmis.org>
To:	Joe Perches <joe@...ches.com>
Cc:	Petr Mladek <pmladek@...e.cz>, linux-kernel@...r.kernel.org,
	Ingo Molnar <mingo@...nel.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Jiri Kosina <jkosina@...e.cz>,
	"H. Peter Anvin" <hpa@...or.com>,
	Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [RFC][PATCH 03/12 v3] tracing: Create seq_buf layer in
 trace_seq

On Fri, 07 Nov 2014 10:59:27 -0800
Joe Perches <joe@...ches.com> wrote:


> > Create a seq_buf layer that trace_seq sits on. The seq_buf will not
> > be limited to page size. This will allow other usages of seq_buf
> > instead of a hard set PAGE_SIZE one that trace_seq has.
> > 
> > Link: http://lkml.kernel.org/r/20141104160221.864997179@goodmis.org
> []
> > diff --git a/include/linux/seq_buf.h b/include/linux/seq_buf.h
> []
> > +extern __printf(2, 3)
> > +int seq_buf_printf(struct seq_buf *s, const char *fmt, ...);
> > +extern __printf(2, 0)
> > +int seq_buf_vprintf(struct seq_buf *s, const char *fmt, va_list args);
> > +extern int
> > +seq_buf_bprintf(struct seq_buf *s, const char *fmt, const u32 *binary);
> > +extern int seq_buf_print_seq(struct seq_file *m, struct seq_buf *s);
> > +extern int seq_buf_to_user(struct seq_buf *s, char __user *ubuf,
> > +			   int cnt);
> > +extern int seq_buf_puts(struct seq_buf *s, const char *str);
> > +extern int seq_buf_putc(struct seq_buf *s, unsigned char c);
> > +extern int seq_buf_putmem(struct seq_buf *s, const void *mem, unsigned int len);
> > +extern int seq_buf_putmem_hex(struct seq_buf *s, const void *mem,
> > +			      unsigned int len);
> > +extern int seq_buf_path(struct seq_buf *s, const struct path *path);
> > +
> > +extern int seq_buf_bitmask(struct seq_buf *s, const unsigned long *maskp,
> > +			   int nmaskbits);
> 
> Maybe remove the extern bits from the function definitions?

Yeah, probably should have done that. Not sure why I kept them. Cut and
paste?

> And maybe the unsigned int len/cnt could be size_t

The struct does get changed later to match seq_file.

> 
> > diff --git a/include/linux/trace_seq.h b/include/linux/trace_seq.h
> []
> > @@ -12,16 +12,14 @@
> >  
> >  struct trace_seq {
> >  	unsigned char		buffer[PAGE_SIZE];
> > -	unsigned int		len;
> > -	unsigned int		readpos;
> > +	struct seq_buf		seq;
> >  	int			full;
> >  };
> >  
> >  static inline void
> >  trace_seq_init(struct trace_seq *s)
> >  {
> > -	s->len = 0;
> > -	s->readpos = 0;
> > +	seq_buf_init(&s->seq, s->buffer, PAGE_SIZE);
> 
> Maybe the PAGE_SIZE uses could be ARRAY_SIZE(s->buffer)
> 
> > diff --git a/kernel/trace/trace_seq.c b/kernel/trace/trace_seq.c
> []
> >  /* How much buffer is written? */
> > -#define TRACE_SEQ_BUF_USED(s) min((s)->len, (unsigned int)(PAGE_SIZE - 1))
> > +#define TRACE_SEQ_BUF_USED(s) min((s)->seq.len, (unsigned int)(PAGE_SIZE - 1))
> 
> min_t?
> maybe this should be FIELD_SIZEOF(struct trace_seq, buffer) - 1

These can be done at a later time. This patch set is focusing on
creation of seq_buf, not cleaning up trace_seq.

-- Steve

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ