WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: [Solved] Kernel tool: perf ?  (Read 10912 times)

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11691
Re: Kernel tool: perf ?
« Reply #15 on: October 08, 2020, 08:00:46 AM »
Hi polikuo
When I had to compile a kernel I needed to load:
Code: [Select]
tce-load -i compiletc perl5 bash ncursesw-dev bc glibc_apps elfutils-devI think the  ncursesw-dev  was only needed for  make menuconfig.

I keep on seeing this popping up in your output:
Code: [Select]
sh: command: line 1: illegal option -cMaybe you need to install  bash?

Offline polikuo

  • Hero Member
  • *****
  • Posts: 758
Re: Kernel tool: perf ?
« Reply #16 on: October 08, 2020, 10:45:59 AM »
I keep on seeing this popping up in your output:
Code: [Select]
sh: command: line 1: illegal option -cMaybe you need to install  bash?

Believe me, I do.

I even switch into bash environment before I type make.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11691
Re: Kernel tool: perf ?
« Reply #17 on: October 08, 2020, 11:31:45 AM »
Hi polikuo
... I even switch into bash environment before I type make.
You shouldn't need to do that. In fact, I would not do that just in case it interferes with some other part of the process.

Do your  grep  and  egrep  commands have the  -c  option enabled?

Offline polikuo

  • Hero Member
  • *****
  • Posts: 758
Re: Kernel tool: perf ?
« Reply #18 on: October 09, 2020, 01:59:05 AM »
You shouldn't need to do that. In fact, I would not do that just in case it interferes with some other part of the process.

I've tried both, same result.

Do your  grep  and  egrep  commands have the  -c  option enabled?

Just try it.
Both busybox grep.tcz versions support -c option.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14843
Re: Kernel tool: perf ?
« Reply #19 on: October 09, 2020, 07:33:55 AM »
It works for me compiled natively on piCore64 using this patch: https://www.spinics.net/lists/stable/msg403445.html

..and:
Code: [Select]
$ tce-load -i compiletc
$ find . -name Makefile.config -type f -exec sed -i 's/-O6//g' {} \;
$ find . -name Makefile.config -type f -exec sed -i 's/-ggdb3//g' {} \;
$ make -C tools/perf JOBS=1 V=1 WERROR=0 EXTRA_CFLAGS="-march=armv8-a+crc -mtune=cortex-a72 -Os -pipe -fcommon"
« Last Edit: October 09, 2020, 07:47:15 AM by Juanito »

Offline polikuo

  • Hero Member
  • *****
  • Posts: 758
Re: Kernel tool: perf ?
« Reply #20 on: October 09, 2020, 09:56:32 AM »
It works for me compiled natively on piCore64 using this patch: https://www.spinics.net/lists/stable/msg403445.html

Great, many thanks.
It successfully compiles. :D

For those who may want to replicate, here's what I did:

1. Clear the onboot.lst, leaving only openssh.tcz for remote access.
2. Save the patch Juanito provides in the previous post.
3. Reboot

Then run these commands:

Code: [Select]
tar xf linux-5.4.51.tar.xz
tce-load -i compiletc
find . -name Makefile.config -type f -exec sed -i 's/-O6//g' {} \;
find . -name Makefile.config -type f -exec sed -i 's/-ggdb3//g' {} \;
CFLAGS='-march=armv8-a+crc -mtune=cortex-a72 -Os -pipe'
CXXFLAGS='-march=armv8-a+crc -mtune=cortex-a72 -Os -pipe -fno-exceptions -fno-rtti'
export CFLAGS CXXFLAGS
cd linux-5.4.51/
patch -p1 < ../perf.patch
make -C tools/perf JOBS=1 V=1 WERROR=0 EXTRA_CFLAGS="-march=armv8-a+crc -mtune=cortex-a72 -Os -pipe -fcommon"

The perf binary should appears in the tools/perf directory.
Enjoy~  :)

P.S. please mark this topic solved.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11691
Re: [Solved] Kernel tool: perf ?
« Reply #21 on: October 09, 2020, 10:35:03 AM »
Hi polikuo
... P.S. please mark this topic solved.
Done. :)