linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Compilation error for target liblockdep
@ 2019-11-18  9:20 Zhengyuan Liu
  2019-11-18 23:14 ` Bart Van Assche
       [not found] ` <SN4PR0401MB359876ED2A2D503638658A679B1A0@SN4PR0401MB3598.namprd04.prod.outlook.com>
  0 siblings, 2 replies; 4+ messages in thread
From: Zhengyuan Liu @ 2019-11-18  9:20 UTC (permalink / raw)
  To: bvanassche, mingo, alexander.levin; +Cc: linux-kernel

Hi, guys,

I got a compilation error while building target liblockdep and I think I'd
better report it to you. The error info showed as bellow:

        # cd SRC/tools
        # make liblockdep
          DESCEND  lib/lockdep
          CC       lockdep.o
        In file included from lockdep.c:33:0:
        ../../../kernel/locking/lockdep.c:53:28: fatal error: linux/rcupdate.h: No such file or directory
        compilation terminated.
        mv: cannot stat './.lockdep.o.tmp': No such file or directory
        /home/lzy/kernel-upstream/linux-linus-ubuntu/tools/build/Makefile.build:96: recipe for target 'lockdep.o' failed
        make[2]: *** [lockdep.o] Error 1
        Makefile:121: recipe for target 'liblockdep-in.o' failed
        make[1]: *** [liblockdep-in.o] Error 2
        Makefile:68: recipe for target 'liblockdep' failed
        make: *** [liblockdep] Error 2

BTW, It was introduced by commit a0b0fd53e1e ("locking/lockdep: Free lock classes that are no longer in use").

Thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Compilation error for target liblockdep
  2019-11-18  9:20 Compilation error for target liblockdep Zhengyuan Liu
@ 2019-11-18 23:14 ` Bart Van Assche
       [not found] ` <SN4PR0401MB359876ED2A2D503638658A679B1A0@SN4PR0401MB3598.namprd04.prod.outlook.com>
  1 sibling, 0 replies; 4+ messages in thread
From: Bart Van Assche @ 2019-11-18 23:14 UTC (permalink / raw)
  To: Zhengyuan Liu, mingo, alexander.levin; +Cc: linux-kernel, Peter Zijlstra

On 11/18/19 1:20 AM, Zhengyuan Liu wrote:
> I got a compilation error while building target liblockdep and I think I'd
> better report it to you. The error info showed as bellow:
> 
>          # cd SRC/tools
>          # make liblockdep
>            DESCEND  lib/lockdep
>            CC       lockdep.o
>          In file included from lockdep.c:33:0:
>          ../../../kernel/locking/lockdep.c:53:28: fatal error: linux/rcupdate.h: No such file or directory
>          compilation terminated.
>          mv: cannot stat './.lockdep.o.tmp': No such file or directory
>          /home/lzy/kernel-upstream/linux-linus-ubuntu/tools/build/Makefile.build:96: recipe for target 'lockdep.o' failed
>          make[2]: *** [lockdep.o] Error 1
>          Makefile:121: recipe for target 'liblockdep-in.o' failed
>          make[1]: *** [liblockdep-in.o] Error 2
>          Makefile:68: recipe for target 'liblockdep' failed
>          make: *** [liblockdep] Error 2
> 
> BTW, It was introduced by commit a0b0fd53e1e ("locking/lockdep: Free lock classes that are no longer in use").

(+Peter)

Hi Zhengyuan Liu,

The approach of liblockdep is fragile. Every time an additional kernel 
header is included from the lockdep code or a change is made in one of 
the kernel headers used by lockdep, that change has to be ported to the 
include files in the tools/lib/lockdep/include/liblockdep/ directory. I 
think there are two possible solutions:
- Making the changes necessary to make liblockdep build again.
- Removing the code under tools/lib/lockdep and porting this code to the
   new KUnit framework. If I understood the KUnit framework correctly it
   is based on UML and hence does not require kernel headers to be
   duplicated.

I'm not sure what the best approach is.

Thanks,

Bart.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Compilation error for target liblockdep
       [not found] ` <SN4PR0401MB359876ED2A2D503638658A679B1A0@SN4PR0401MB3598.namprd04.prod.outlook.com>
@ 2020-02-14  5:57   ` Bart Van Assche
       [not found]     ` <SN4PR0401MB35983B3ACED57F66634CF90E9BDA0@SN4PR0401MB3598.namprd04.prod.outlook.com>
  0 siblings, 1 reply; 4+ messages in thread
From: Bart Van Assche @ 2020-02-14  5:57 UTC (permalink / raw)
  To: Johannes Thumshirn, Zhengyuan Liu, mingo, alexander.levin
  Cc: linux-kernel, Sasha Levin

On 2020-02-13 04:59, Johannes Thumshirn wrote:
> On 18/11/2019 10:20, Zhengyuan Liu wrote:
>> Hi, guys,
>>
>> I got a compilation error while building target liblockdep and I think I'd
>> better report it to you. The error info showed as bellow:
>>
>>          # cd SRC/tools
>>          # make liblockdep
>>            DESCEND  lib/lockdep
>>            CC       lockdep.o
>>          In file included from lockdep.c:33:0:
>>          ../../../kernel/locking/lockdep.c:53:28: fatal error: linux/rcupdate.h: No such file or directory
>>          compilation terminated.
>>          mv: cannot stat './.lockdep.o.tmp': No such file or directory
>>          /home/lzy/kernel-upstream/linux-linus-ubuntu/tools/build/Makefile.build:96: recipe for target 'lockdep.o' failed
>>          make[2]: *** [lockdep.o] Error 1
>>          Makefile:121: recipe for target 'liblockdep-in.o' failed
>>          make[1]: *** [liblockdep-in.o] Error 2
>>          Makefile:68: recipe for target 'liblockdep' failed
>>          make: *** [liblockdep] Error 2
>>
>> BTW, It was introduced by commit a0b0fd53e1e ("locking/lockdep: Free lock classes that are no longer in use").
> 
> This error still pops up here on current master
> HEAD: 0bf999f9c5e74c7ecf9dafb527146601e5c848b9

I'm not sure it's worth fixing the tests under tools/lib/lockdep since
keeping these tests working requires modifying the headers under
tools/lib/lockdep/include/ every time the kernel headers under include/
are changed. How about removing tools/lib/lockdep entirely and
converting these lockdep tests to the KUnit framework? KUnit is based on
UML and I think that's a much more robust approach. For more information
about KUnit, see also https://lwn.net/Articles/780985/.

Thanks,

Bart.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Compilation error for target liblockdep
       [not found]     ` <SN4PR0401MB35983B3ACED57F66634CF90E9BDA0@SN4PR0401MB3598.namprd04.prod.outlook.com>
@ 2020-04-15  2:09       ` Bart Van Assche
  0 siblings, 0 replies; 4+ messages in thread
From: Bart Van Assche @ 2020-04-15  2:09 UTC (permalink / raw)
  To: Johannes Thumshirn, Zhengyuan Liu, mingo, alexander.levin
  Cc: linux-kernel, Sasha Levin

On 2020-04-14 06:08, Johannes Thumshirn wrote:
> These files aren't unit tests for lockdep, so they can't be converted to 
> KUnit. liblockdep is a stand alone library bringing lockdep's 
> functionallity to pthread via LDPRELOAD, see also:
> https://lwn.net/Articles/536363/

How big is the user base of liblockdep? How many alternatives exist for
liblockdep? Are these alternatives better or worse than liblockdep? See
also:
* https://clang.llvm.org/docs/ThreadSafetyAnalysis.html
* https://github.com/google/sanitizers/wiki/ThreadSanitizerCppManual
* http://valgrind.org/docs/manual/hg-manual.html

Bart.



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-04-15  2:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-18  9:20 Compilation error for target liblockdep Zhengyuan Liu
2019-11-18 23:14 ` Bart Van Assche
     [not found] ` <SN4PR0401MB359876ED2A2D503638658A679B1A0@SN4PR0401MB3598.namprd04.prod.outlook.com>
2020-02-14  5:57   ` Bart Van Assche
     [not found]     ` <SN4PR0401MB35983B3ACED57F66634CF90E9BDA0@SN4PR0401MB3598.namprd04.prod.outlook.com>
2020-04-15  2:09       ` Bart Van Assche

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).