This is an archive of the discontinued LLVM Phabricator instance.

[XRay] Remove a path-length limitation
ClosedPublic

Authored by jmorse on Oct 1 2018, 9:00 AM.

Details

Summary

Hi Dean et al,

Could we please remove the path length limitation referred to in this patch -- the path-to and binary-name of xray logfiles are implicitly truncated to 128 chars each. We've run into some (localized) trouble:

  • r343295 [0] caused the path that an xray logfile is written to, for one test, to be substantially longer
  • The log-file-opening code effectively limits the path to xray logfiles to ~128 characters
  • On our local test setup, the path ends up being 135 characters.
  • This kills the test

The net effect of the "HalfLength" limitation is that fdr-thread-order.cc writes its logfile in a higher level directory, later failing the test because the output can't be found. The purpose of this limitation isn't clear to me, and it seems much more beneficial to let, on error, the code fall through to the "name too long" code path, which reports something useful instead of silently dropping a file somewhere else.

[0] https://reviews.llvm.org/rL343295

Diff Detail

Repository
rL LLVM

Event Timeline

jmorse created this revision.Oct 1 2018, 9:00 AM
Herald added subscribers: Restricted Project, llvm-commits. · View Herald TranscriptOct 1 2018, 9:00 AM
MaskRay accepted this revision.Oct 1 2018, 10:06 AM

I don't know why the path is limited to 128, 255 would look good enough for me.

FreeBSD sys/sys/syslimits.h

#define	NAME_MAX		  255	/* max bytes in a file name */
#define	PATH_MAX		 1024	/* max bytes in pathname */

Linux include/uapi/linux/limits.h

#define NAME_MAX         255	/* # chars in a file name */
#define PATH_MAX        4096	/* # chars in a path name including nul */
`
This revision is now accepted and ready to land.Oct 1 2018, 10:06 AM
This revision was automatically updated to reflect the committed changes.