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] [day] [month] [year] [list]
Date:   Thu, 2 Feb 2023 15:29:32 -0500
From:   Steven Rostedt <rostedt@...dmis.org>
To:     Eddie James <eajames@...ux.ibm.com>
Cc:     linux-fsi@...ts.ozlabs.org, linux-trace-kernel@...r.kernel.org,
        devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
        mhiramat@...nel.org, alistair@...ple.id.au, joel@....id.au,
        jk@...abs.org, andrew@...id.au, robh+dt@...nel.org,
        krzysztof.kozlowski+dt@...aro.org
Subject: Re: [PATCH v4 2/2] fsi: Add IBM I2C Responder virtual FSI master

On Thu,  2 Feb 2023 13:19:26 -0600
Eddie James <eajames@...ux.ibm.com> wrote:

> +#include <linux/tracepoint.h>
> +
> +TRACE_EVENT(i2cr_i2c_error,
> +	TP_PROTO(const struct i2c_client *client, __be32 command, int rc),
> +	TP_ARGS(client, command, rc),
> +	TP_STRUCT__entry(
> +		__field(int, bus)
> +		__field(unsigned short, addr)

For all of these, I would put the "unsigned short addr" at the end of
the TP_STRUCT__entry(). That's because you will inject two wasted bytes
in the structure that is generated. Granted, the tracing will likely
word align the result anyway, but still, we don't want holes in the
middle of the structure.

-- Steve


> +		__array(unsigned char, command, sizeof(__be32))
> +		__field(int, rc)
> +	),
> +	TP_fast_assign(
> +		__entry->bus = client->adapter->nr;
> +		__entry->addr = client->addr;
> +		memcpy(__entry->command, &command, sizeof(__be32));
> +		__entry->rc = rc;
> +	),
> +	TP_printk("%d-%02x command:{ %*ph } rc:%d", __entry->bus, __entry->addr,
> +		  (int)sizeof(__be32), __entry->command, __entry->rc)
> +);
> +
> +TRACE_EVENT(i2cr_read,
> +	TP_PROTO(const struct i2c_client *client, uint32_t address, size_t size, __be64 result),
> +	TP_ARGS(client, address, size, result),
> +	TP_STRUCT__entry(
> +		__field(int, bus)
> +		__field(unsigned short, addr)
> +		__field(uint32_t, address)
> +		__field(size_t, size)
> +		__array(unsigned char, result, sizeof(__be64))
> +	),
> +	TP_fast_assign(
> +		__entry->bus = client->adapter->nr;
> +		__entry->addr = client->addr;
> +		__entry->address = address;
> +		__entry->size = size;
> +		memcpy(__entry->result, &result, sizeof(__be64));
> +	),
> +	TP_printk("%d-%02x address:%08x size:%zu { %*ph }", __entry->bus, __entry->addr,
> +		  __entry->address, __entry->size, (int)__entry->size, __entry->result)
> +);
> +

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ