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, 22 Jun 2016 14:40:56 -0600
From:	Jason Gunthorpe <jgunthorpe@...idianresearch.com>
To:	Joe Perches <joe@...ches.com>
Cc:	Matan Barak <matanb@...lanox.com>,
	Leon Romanovsky <leonro@...lanox.com>, netdev@...r.kernel.org,
	linux-rdma@...r.kernel.org,
	linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] mellanox: mlx5: Use logging functions to reduce text
 ~10k/5%

On Wed, Jun 22, 2016 at 11:23:59AM -0700, Joe Perches wrote:

> The output changes now do not include line #, but do include the
> function offset.

I've been using a technique like this in some code with good results:

struct source_location
{
   const char *file;
   const char *func;
   const char *format;
   uint16_t line;
};
#define _LOCATION(format) ({static const source_location __location__ = {\
             __FILE__,__PRETTY_FUNCTION__,format,__LINE__};\
	     &__location__;})

void _mlx5_core_err(const struct source_location *loc,struct mlx5_core_dev *dev, ...);
#define mlx5_core_err(dev,format,...) _mlx_core_err(_LOCATION(format),dev,__VA_ARGS__)

The call site .text overhead is the about same as what you have, but
this still retains the function and line number information in
.rodata.

Jason

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ