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]
Date:	Wed, 4 Mar 2009 13:12:59 +0100
From:	Frederic Weisbecker <fweisbec@...il.com>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	Ingo Molnar <mingo@...e.hu>, Steven Rostedt <rostedt@...dmis.org>,
	Török Edwin <edwintorok@...il.com>,
	Jason Baron <jbaron@...hat.com>,
	lkml <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH -v2] tracing: lockdep tracepoints

On Wed, Mar 04, 2009 at 12:58:03PM +0100, Peter Zijlstra wrote:
> On Wed, 2009-03-04 at 12:43 +0100, Ingo Molnar wrote:
> > 
> > > +TRACE_FORMAT(lock_contended,
> > > +     TPPROTO(struct lockdep_map *lock, unsigned long ip),
> > > +     TPARGS(lock, ip),
> > > +     TPFMT("%s", lock->name)
> > > +     );
> > 
> > Would it be possible to use the C syntax tracepoints perhaps? 
> > They are bigger:
> > 
> >      TRACE_EVENT_FORMAT(sched_switch,
> >         TPPROTO(struct rq *rq, struct task_struct *prev,
> >                 struct task_struct *next),
> >         TPARGS(rq, prev, next),
> >         TPFMT("task %s:%d ==> %s:%d",
> >               prev->comm, prev->pid, next->comm, next->pid),
> >         TRACE_STRUCT(
> >                 TRACE_FIELD(pid_t, prev_pid, prev->pid)
> >                 TRACE_FIELD(int, prev_prio, prev->prio)
> >                 TRACE_FIELD_SPECIAL(char next_comm[TASK_COMM_LEN],
> >                                     next_comm,
> >                                     TPCMD(memcpy(TRACE_ENTRY->next_comm,
> >                                                  next->comm,
> >                                                  TASK_COMM_LEN)))
> >                 TRACE_FIELD(pid_t, next_pid, next->pid)
> >                 TRACE_FIELD(int, next_prio, next->prio)
> >         ),
> >         TPRAWFMT("prev %d:%d ==> next %s:%d:%d")
> >         );
> 
> I'm not quite sure how to do strings with those. The IRQ tracepoints
> cheat and omit the string, and the sched tracepoints cheat and use this
> static sized comm array.
> 


The TRACE_FIELD_SPECIAL is only used in case of complex assignment,
those that can't be done in a simple "=" expression.

All you need is simply:

TRACE_FORMAT(lock_contended,
     TPPROTO(struct lockdep_map *lock, unsigned long ip),
     TPARGS(lock, ip),
     TPFMT("%s", lock->name)
     TRACE_STRUCT(
	TRACE_FIELD(char *, name, lock->name)
     )
     TPRAWFMT("%s");
);

--
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