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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <928CFBE8E7CB0040959E56B4EA41A77E08F3C3A1@irsmsx504.ger.corp.intel.com>
Date:	Tue, 25 Nov 2008 11:23:09 +0000
From:	"Metzger, Markus T" <markus.t.metzger@...el.com>
To:	Frédéric Weisbecker <fweisbec@...il.com>
CC:	"hpa@...or.com" <hpa@...or.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"mingo@...e.hu" <mingo@...e.hu>,
	"tglx@...utronix.de" <tglx@...utronix.de>,
	"markus.t.metzger@...il.com" <markus.t.metzger@...il.com>,
	"roland@...hat.com" <roland@...hat.com>,
	"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
	"mtk.manpages@...il.com" <mtk.manpages@...il.com>,
	"eranian@...glemail.com" <eranian@...glemail.com>,
	"Villacis, Juan" <juan.villacis@...el.com>,
	Andi Kleen <andi@...stfloor.org>
Subject: RE: [patch 9/9] x86, bts, ftrace: a BTS ftrace plug-in prototype

>-----Original Message-----
>From: Frédéric Weisbecker [mailto:fweisbec@...il.com] 
>Sent: Dienstag, 25. November 2008 11:40
>To: Metzger, Markus T

>2008/11/25 Markus Metzger <markus.t.metzger@...el.com>:
>> +static enum print_line_t bts_trace_print_line(struct 
>trace_iterator *iter)
>> +{
>> +       struct trace_entry *entry = iter->ent;
>> +       struct trace_seq *seq = &iter->seq;
>> +       struct bts_entry *it;
>> +
>> +       trace_assign_type(it, entry);
>> +
>> +       if (entry->type == TRACE_BTS) {
>> +               int ret;
>> +#ifdef CONFIG_KALLSYMS
>> +               char function[KSYM_SYMBOL_LEN];
>> +               sprint_symbol(function, it->from);
>> +#else
>> +               char *function = "<unknown>";
>> +#endif
>> +
>> +               ret = trace_seq_printf(seq, "%4d  0x%lx -> 
>0x%lx [%s]\n",
>> +                                      entry->cpu, it->from, 
>it->to, function);
>
>
>You can use seq_print_ip_sym() which handles the ifdef and the 
>sprint_symbol...

Thanks.


>> +void trace_bts(struct trace_array *tr, unsigned long from, 
>unsigned long to)
>> +{
>> +       struct ring_buffer_event *event;
>> +       struct bts_entry *entry;
>> +       unsigned long irq;
>> +
>> +       event = ring_buffer_lock_reserve(tr->buffer, 
>sizeof(*entry), &irq);
>> +       if (!event)
>> +               return;
>> +       entry   = ring_buffer_event_data(event);
>> +       tracing_generic_entry_update(&entry->ent, 0, from);
>> +       entry->ent.type = TRACE_BTS;
>> +       entry->ent.cpu = smp_processor_id();
>
>
>If you look at the struct trace_entry, you will see find the cpu
>field. It is already inserted automatically :-)

I am using that field in struct trace_entry.

Without the assignment, though, I've seen funny cpu numbers. It seems that the field is not filled automatically.


regards,
markus.
---------------------------------------------------------------------
Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen Germany
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Douglas Lusk, Peter Gleissner, Hannes Schwaderer
Registergericht: Muenchen HRB 47456 Ust.-IdNr.
VAT Registration No.: DE129385895
Citibank Frankfurt (BLZ 502 109 00) 600119052

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

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