Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1398922 - Review Request: uftrace - User-space function call tracer for C and C++ programs
Summary: Review Request: uftrace - User-space function call tracer for C and C++ programs
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Nobody's working on this, feel free to take it
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1525268 (view as bug list)
Depends On:
Blocks: FE-NEEDSPONSOR
TreeView+ depends on / blocked
 
Reported: 2016-11-27 11:07 UTC by Benjamin Kircher
Modified: 2019-01-10 10:51 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-01-10 10:51:18 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Benjamin Kircher 2016-11-27 11:07:40 UTC
Spec URL: https://raw.githubusercontent.com/bkircher/uftrace-fedora/master/uftrace-0.6-1.fc25.src.rpm

SRPM URL: https://raw.githubusercontent.com/bkircher/uftrace-fedora/master/uftrace.spec

Description:
The uftrace tool is used to trace and analyze the execution of a program
written in C or C++. It was heavily inspired by the ftrace framework of the
Linux kernel (especially function graph tracer) but for user-space programs. It
supports various kinds of commands and filters to help in the analysis of
program execution and performance.

Fedora Account System Username: bkircher

Comment 1 Yunying Sun 2016-11-28 04:20:07 UTC
An unformal review:

1. No version specified in %changelog.
changelog format: https://fedoraproject.org/wiki/Packaging:Guidelines#Changelogs

2. Static libraries are discouraged. Add "--disable-static" in %configure, and add -devel package where *.so could be included.
Refer to:
https://fedoraproject.org/wiki/Packaging:Guidelines#Packaging_Static_Libraries
https://fedoraproject.org/wiki/Packaging:Guidelines#DevelPackages

3. Missing %doc for README.md.

4. Use %{name} instead of fixed string "uftrace" would be better in spec file.

Comment 2 Benjamin Kircher 2016-11-28 14:46:11 UTC
Thank you.

> 1. No version specified in %changelog.
Fixed.

> Static libraries are discouraged. Add "--disable-static" in %configure, and add -devel package where *.so could be included.
There are no static libraries in this package. The libmcount*.so files are actually needed to run the application and get loaded by the `uftrace` binary dynamically at run-time. I don't think this is really a plugin system but seems to work kind of the same way.

> 3. Missing %doc for README.md.
Fixed.

> 4. Use %{name} instead of fixed string "uftrace" would be better in spec file.
Fixed.

New SPEC file: https://raw.githubusercontent.com/bkircher/uftrace-fedora/master/uftrace.spec

New SRPM: https://raw.githubusercontent.com/bkircher/uftrace-fedora/master/uftrace-0.6-2.fc25.src.rpm

Comment 3 Benjamin Kircher 2016-11-29 08:55:32 UTC
I was able to talk to the author of uftrace about those libs. The libmcount* libraries are linked into the target process (using LD_PRELOAD) rather than uftrace itself. They do the all the work to generate trace data and talk to uftrace.

Comment 4 Yunying Sun 2016-11-30 06:29:36 UTC
(In reply to Benjamin Kircher from comment #2)
> Thank you.
> 
> > 1. No version specified in %changelog.
> Fixed.
> 
> > Static libraries are discouraged. Add "--disable-static" in %configure, and add -devel package where *.so could be included.
> There are no static libraries in this package. The libmcount*.so files are
> actually needed to run the application and get loaded by the `uftrace`
> binary dynamically at run-time. I don't think this is really a plugin system
> but seems to work kind of the same way.
> 
Sorry, as a new packager myself, I misunderstood the rules about .so files. There're no versioned shared library files in this package, so the unversioned .so should be included in the base package. And since it has no static libs, no header files, no need for a -devel package.

Comment 5 Benjamin Kircher 2016-11-30 09:06:27 UTC
> Sorry, as a new packager myself, I misunderstood the rules about .so files.
Oh, no problem. The question what these libraries are doing is quite justified.

Comment 6 Benjamin Kircher 2016-12-14 08:52:36 UTC
FYI, a link to a 6 minute lightning talk by the author about uftrace:
https://youtu.be/LNav5qvyK7I

Comment 7 Igor Gnatenko 2016-12-14 09:42:28 UTC
* ./configure --prefix=%{_prefix} --libdir=%{_libdir} -> %configure
Usually, but unfortunately it's not the case right now. Main problem is that CFLAGS/LDFLAGS are ignored.
you can do something like:
export CFLAGS="%{__global_cflags}"
exprot LDFLAGS="%{__global_ldflags}" before configure call
* rm -rf $RPM_BUILD_ROOT is not needed
* I think license is GPLv2+, not GPLv2
* Missing BuildRequires: gcc
* I would recommend make URL without macro, so it will be easily clickable

Otherwise, looks good from first glance.

Unfortunately you are not in packagers group, so you need a sponsor.
Looks like you need to start from https://fedoraproject.org/wiki/Join_the_package_collection_maintainers#Introduce_yourself point.

Comment 8 Benjamin Kircher 2016-12-14 15:59:15 UTC
Thank you.

> * ./configure  -> %configure
> Usually, but unfortunately it's not the case right now.
Correct, configure is a shell script here.

> Main problem is that CFLAGS/LDFLAGS are ignored.
> you can do something like:
> export CFLAGS="%{__global_cflags}"
> exprot LDFLAGS="%{__global_ldflags}" before configure call
Fixed.

> * rm -rf $RPM_BUILD_ROOT is not needed
Fixed.

> * I think license is GPLv2+, not GPLv2
Not 100% sure on this one. The license header used in the source files explicitly states version 2. The usual "either version 2 of the License, or (at your option) any later version" is missing here in the text. I ask the author to clarify this.

> * Missing BuildRequires: gcc
Fixed.

> * I would recommend make URL without macro, so it will be easily clickable
Makes sense. Followed your recommendation.

Comment 9 Michael Schwendt 2016-12-15 12:57:11 UTC
> * I think license is GPLv2+, not GPLv2

It's useless to write that without giving a rationale.

Have you pointed "fedora-review -b 1398922" at this ticket yet to see which test results it comes up with?

Comment 11 Benjamin Kircher 2016-12-15 14:18:26 UTC
Hi Michael. Thank you for looking into this.

> > * I think license is GPLv2+, not GPLv2
>
> It's useless to write that without giving a rationale.
>
> Have you pointed "fedora-review -b 1398922" at this ticket yet to see which
> test results it comes up with?
Not sure if you asked Igor or me here  (Igor, I presume). I don't want to get ahead of things here but anyway: Yes I did just now.

rpmlint reports 3 errors (incorrect-fsf-address) and lots of warnings (partially useful) i.e., about those unversioned so-files in the package.

For your convenience, please find results here:
https://raw.githubusercontent.com/bkircher/uftrace-fedora/master/review.txt

Things I should fix (I guess, waiting for input from you guys here):

1) These BR are not needed: gcc
2) Unversioned so-files not in -devel subpackage. Should we open a ticket with Fedora Packaging Committee as per https://fedoraproject.org/wiki/Packaging:Guidelines?rd=Packaging/Guidelines#DevelPackages because of that?

Comment 12 Michael Schwendt 2016-12-15 18:30:42 UTC
The fedora-review tool is equally helpful to the package maintainer as to the reviewer.


About GPLv2 or GPLv2+, a simple grep turns up these false positives:

  $ grep "or later" * -R
  libtraceevent/trace-seq.c: * into a special buffer (@s) for later retrieval by a sequencer
  libtraceevent/event-parse.c:	/* Save for later use. */


> 1) These BR are not needed: gcc

Wouldn't be a big issue. The default buildroot doesn't contain gcc-c++ anymore, however. So, if gcc were not found, you would notice that with a failing build.


> 2) Unversioned so-files not in -devel subpackage.

They are dlopen()ed plugins. I'd rather adjust the INSTALL_LIB_PATH definition before compiling uftrace and install them into a private path below $libdir instead of directly into $libdir.

Comment 13 Benjamin Kircher 2017-03-03 07:46:02 UTC
Sorry for letting this lie around for 9 weeks.

> About GPLv2 or GPLv2+
You're right. It is GPLv2. Author confirmed this.

> 1) These BR are not needed: gcc
BR removed.

> I'd rather adjust the INSTALL_LIB_PATH definition before compiling uftrace and install them into a private path below $libdir
Done exactly so.


Additional changes:

- added %check section
- new upstream release
- bash completion script is installed to /etc/bash_completion.d
- add `ExclusiveArch:`, uftrace only supports x86_64 and ARM (v6,7) for now


New SPEC file: https://raw.githubusercontent.com/bkircher/uftrace-fedora/master/uftrace.spec

New SRPM: https://raw.githubusercontent.com/bkircher/uftrace-fedora/master/uftrace-0.6.1-2.fc25.src.rpm

Comment 15 Benjamin Kircher 2017-04-04 13:42:19 UTC
A copr repository is available here: https://copr.fedorainfracloud.org/coprs/bkircher/uftrace/

Comment 16 Benjamin Kircher 2017-05-17 09:36:15 UTC
FYI, some changes related to ./configure script and Fedora packaging happened in upstream here:
https://github.com/namhyung/uftrace/pull/98

Not in a release yet, though.

Comment 17 Dridi Boukelmoune 2017-05-17 09:49:01 UTC
The next release should work fine with the %configure macro [1] so that should soon not be a problem. If you think that the shared object should be in a private directory because they're not directly linked to but rather pre-loaded you should discuss this upstream and point them to the relevant Fedora guidelines.

You can however do that in your spec like this:

    %configure --libdir=%{_libdir}/%{name}

Until the next release, you can patch [2,3] the configure script in your spec.

As upstream mentioned on github, I was about to recommend verbose building to

1) verify that the flags are properly passed and
2) make it easier to troubleshoot remote builds in general:

    %make_build V=1

There are other issues with the spec, have a look at the rpmlint output for starters. I found one in the changelog that I'm sure rpmlint will report, I'll keep the others for later.

[1] https://github.com/namhyung/uftrace/pull/98
[2] https://patch-diff.githubusercontent.com/raw/namhyung/uftrace/pull/98.patch
[3] https://patch-diff.githubusercontent.com/raw/namhyung/uftrace/pull/98.diff

Comment 18 Benjamin Kircher 2017-06-28 08:33:18 UTC
Thanks Dridi for your work. New upstream version contains your changes so no need to patch.

Changes:
- New upstream release 0.7
- Use %configure macro
- Do verbose build

New SPEC file: https://raw.githubusercontent.com/bkircher/uftrace-fedora/master/uftrace.spec

New SRPM: https://raw.githubusercontent.com/bkircher/uftrace-fedora/master/uftrace-0.7-1.fc25.src.rpm

Comment 19 Dridi Boukelmoune 2017-08-21 07:45:08 UTC
I have some packaging work ahead, I'll have a look at your update then. Don't forget to find a sponsor in the mean time. Maybe I can do the formal review, but I can't approve it.

Comment 20 Benjamin Kircher 2017-08-21 12:09:34 UTC
Thanks, Dridi.

> Don't forget to find a sponsor in the mean time.

I'll do my best :)

Comment 21 Michal Schmidt 2017-10-20 10:33:20 UTC
(In reply to Benjamin Kircher from comment #13)
> > 1) These BR are not needed: gcc
> BR removed.

It should stay. See
https://fedoraproject.org/wiki/Packaging:C_and_C%2B%2B#BuildRequires_and_Requires
When rpmlint and the Guidelines disagree, side with the Guidelines. rpmlint is not always up to date.

> %files
> %{_bindir}/uftrace
> %{_libdir}/%{name}/libmcount*.so

Your package should own the directory %{_libdir}/%{name} itself, not just the file in it.

> %{_mandir}/man1/uftrace*.1*
> %{_sysconfdir}/bash_completion.d/uftrace

Please place packaged completions under %{_datadir}/bash_completion/completions/ and keep /etc for the administrator.
The current practice is to co-own the completion directories, though I would like to see that changed (bug #1504616).

> * Wed Jun 28 2017 Benjamin Kircher <benjamin.kircher> - 0.7-1
> - New upstream release
> - Use %configure macro

Beware of macro expansion inside the changelog. Use double percent signs to prevent expansion, like this:
  - Use %%configure macro

Comment 22 Robert-André Mauchin 🐧 2017-12-13 16:35:05 UTC
*** Bug 1525268 has been marked as a duplicate of this bug. ***

Comment 23 Benjamin Kircher 2019-01-10 10:51:18 UTC
I'm not interested in the package anymore


Note You need to log in before you can comment on or make changes to this bug.