How to install perf on a custom build kernel?












2















I want to use profiling tools in linux. I see some information say Oprofile is not support in Ubuntu 12.04 and the alternate is perf. So I try to install perf.



I installed linux-tools-common, linux-base and linux-tools.



Then I type perf in the terminal and it returns:



perf not found for kernel 3.12.6
You may need to install linux-tools-3.12.6-3.12.6


But I could not install either linux-tools-3.12.6-3.12.6 (I think it's a wrong name) or linux-tools-3.12.6.



Is it a wrong way to install and use perf in that way, or is it the kernel problem(the kernel is compiled by myself)?










share|improve this question

























  • askubuntu.com/questions/50145/…

    – Rakesh Godhala
    Dec 24 '13 at 10:27











  • You appear to have installed a custom kernel. 3.12 is not in Ubuntu official repositories. This means you'll have to install the tools yourself or to revert the custom kernel installation. Please provide more information on your custom kernel (how did you install it?) Please edit your question when doing so.

    – gertvdijk
    Dec 24 '13 at 16:20













  • Thank you for the reply! I updated the building steps. I think I just upgraded the kernel without changing the basic ubuntu settings.

    – user2002993
    Dec 26 '13 at 1:49











  • I am sorry, Braiam. I don't understand your meaning. I don't have any answer of installing perf on custom kernel. I edit my question to add the information of how I building my custom kernel due to gertvdijk asking. You mean I should add the information below the answer section? But what do you mean by editing my question?

    – user2002993
    Dec 30 '13 at 2:49
















2















I want to use profiling tools in linux. I see some information say Oprofile is not support in Ubuntu 12.04 and the alternate is perf. So I try to install perf.



I installed linux-tools-common, linux-base and linux-tools.



Then I type perf in the terminal and it returns:



perf not found for kernel 3.12.6
You may need to install linux-tools-3.12.6-3.12.6


But I could not install either linux-tools-3.12.6-3.12.6 (I think it's a wrong name) or linux-tools-3.12.6.



Is it a wrong way to install and use perf in that way, or is it the kernel problem(the kernel is compiled by myself)?










share|improve this question

























  • askubuntu.com/questions/50145/…

    – Rakesh Godhala
    Dec 24 '13 at 10:27











  • You appear to have installed a custom kernel. 3.12 is not in Ubuntu official repositories. This means you'll have to install the tools yourself or to revert the custom kernel installation. Please provide more information on your custom kernel (how did you install it?) Please edit your question when doing so.

    – gertvdijk
    Dec 24 '13 at 16:20













  • Thank you for the reply! I updated the building steps. I think I just upgraded the kernel without changing the basic ubuntu settings.

    – user2002993
    Dec 26 '13 at 1:49











  • I am sorry, Braiam. I don't understand your meaning. I don't have any answer of installing perf on custom kernel. I edit my question to add the information of how I building my custom kernel due to gertvdijk asking. You mean I should add the information below the answer section? But what do you mean by editing my question?

    – user2002993
    Dec 30 '13 at 2:49














2












2








2


1






I want to use profiling tools in linux. I see some information say Oprofile is not support in Ubuntu 12.04 and the alternate is perf. So I try to install perf.



I installed linux-tools-common, linux-base and linux-tools.



Then I type perf in the terminal and it returns:



perf not found for kernel 3.12.6
You may need to install linux-tools-3.12.6-3.12.6


But I could not install either linux-tools-3.12.6-3.12.6 (I think it's a wrong name) or linux-tools-3.12.6.



Is it a wrong way to install and use perf in that way, or is it the kernel problem(the kernel is compiled by myself)?










share|improve this question
















I want to use profiling tools in linux. I see some information say Oprofile is not support in Ubuntu 12.04 and the alternate is perf. So I try to install perf.



I installed linux-tools-common, linux-base and linux-tools.



Then I type perf in the terminal and it returns:



perf not found for kernel 3.12.6
You may need to install linux-tools-3.12.6-3.12.6


But I could not install either linux-tools-3.12.6-3.12.6 (I think it's a wrong name) or linux-tools-3.12.6.



Is it a wrong way to install and use perf in that way, or is it the kernel problem(the kernel is compiled by myself)?







apt kernel






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 27 '13 at 20:05









Braiam

51.9k20136221




51.9k20136221










asked Dec 24 '13 at 10:07









user2002993user2002993

11315




11315













  • askubuntu.com/questions/50145/…

    – Rakesh Godhala
    Dec 24 '13 at 10:27











  • You appear to have installed a custom kernel. 3.12 is not in Ubuntu official repositories. This means you'll have to install the tools yourself or to revert the custom kernel installation. Please provide more information on your custom kernel (how did you install it?) Please edit your question when doing so.

    – gertvdijk
    Dec 24 '13 at 16:20













  • Thank you for the reply! I updated the building steps. I think I just upgraded the kernel without changing the basic ubuntu settings.

    – user2002993
    Dec 26 '13 at 1:49











  • I am sorry, Braiam. I don't understand your meaning. I don't have any answer of installing perf on custom kernel. I edit my question to add the information of how I building my custom kernel due to gertvdijk asking. You mean I should add the information below the answer section? But what do you mean by editing my question?

    – user2002993
    Dec 30 '13 at 2:49



















  • askubuntu.com/questions/50145/…

    – Rakesh Godhala
    Dec 24 '13 at 10:27











  • You appear to have installed a custom kernel. 3.12 is not in Ubuntu official repositories. This means you'll have to install the tools yourself or to revert the custom kernel installation. Please provide more information on your custom kernel (how did you install it?) Please edit your question when doing so.

    – gertvdijk
    Dec 24 '13 at 16:20













  • Thank you for the reply! I updated the building steps. I think I just upgraded the kernel without changing the basic ubuntu settings.

    – user2002993
    Dec 26 '13 at 1:49











  • I am sorry, Braiam. I don't understand your meaning. I don't have any answer of installing perf on custom kernel. I edit my question to add the information of how I building my custom kernel due to gertvdijk asking. You mean I should add the information below the answer section? But what do you mean by editing my question?

    – user2002993
    Dec 30 '13 at 2:49

















askubuntu.com/questions/50145/…

– Rakesh Godhala
Dec 24 '13 at 10:27





askubuntu.com/questions/50145/…

– Rakesh Godhala
Dec 24 '13 at 10:27













You appear to have installed a custom kernel. 3.12 is not in Ubuntu official repositories. This means you'll have to install the tools yourself or to revert the custom kernel installation. Please provide more information on your custom kernel (how did you install it?) Please edit your question when doing so.

– gertvdijk
Dec 24 '13 at 16:20







You appear to have installed a custom kernel. 3.12 is not in Ubuntu official repositories. This means you'll have to install the tools yourself or to revert the custom kernel installation. Please provide more information on your custom kernel (how did you install it?) Please edit your question when doing so.

– gertvdijk
Dec 24 '13 at 16:20















Thank you for the reply! I updated the building steps. I think I just upgraded the kernel without changing the basic ubuntu settings.

– user2002993
Dec 26 '13 at 1:49





Thank you for the reply! I updated the building steps. I think I just upgraded the kernel without changing the basic ubuntu settings.

– user2002993
Dec 26 '13 at 1:49













I am sorry, Braiam. I don't understand your meaning. I don't have any answer of installing perf on custom kernel. I edit my question to add the information of how I building my custom kernel due to gertvdijk asking. You mean I should add the information below the answer section? But what do you mean by editing my question?

– user2002993
Dec 30 '13 at 2:49





I am sorry, Braiam. I don't understand your meaning. I don't have any answer of installing perf on custom kernel. I edit my question to add the information of how I building my custom kernel due to gertvdijk asking. You mean I should add the information below the answer section? But what do you mean by editing my question?

– user2002993
Dec 30 '13 at 2:49










2 Answers
2






active

oldest

votes


















2














You may need to build the tools since you are using a custom kernel. If you want to use linux tools from the repositories, you need to use the kernel provided by Ubuntu. Linux tools checks your kernel version and if it don't match it's own it will not run.






share|improve this answer
























  • I see! I try to use perf in my original ubuntu kernel and it works. So isn't there any way to use perf in custom kernel?

    – user2002993
    Dec 26 '13 at 2:05













  • @user2002993 compile it yourself.

    – Braiam
    Mar 16 '14 at 17:14











  • @Braiam This is a very late comment, but would you mind adding some detail about where to find the source for linux-tools (eg. in the kernel source) and how to compile it? (eg. run make in linux/tools/perf) etc? I'd make for a more complete answer.

    – ffledgling
    Apr 30 '18 at 14:36






  • 1





    @ffledgling unix.stackexchange.com/q/92957/41104

    – Braiam
    Apr 30 '18 at 14:41



















0














On ubuntu "perf" is a shell script that calls a kernel specific perf binary.



But that's not actually needed, perf is compatible. Just remove the wrapper from /usr/bin and copy any of the perf binaries from ./lib/linux-tools* to it.






share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "89"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f395118%2fhow-to-install-perf-on-a-custom-build-kernel%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    2














    You may need to build the tools since you are using a custom kernel. If you want to use linux tools from the repositories, you need to use the kernel provided by Ubuntu. Linux tools checks your kernel version and if it don't match it's own it will not run.






    share|improve this answer
























    • I see! I try to use perf in my original ubuntu kernel and it works. So isn't there any way to use perf in custom kernel?

      – user2002993
      Dec 26 '13 at 2:05













    • @user2002993 compile it yourself.

      – Braiam
      Mar 16 '14 at 17:14











    • @Braiam This is a very late comment, but would you mind adding some detail about where to find the source for linux-tools (eg. in the kernel source) and how to compile it? (eg. run make in linux/tools/perf) etc? I'd make for a more complete answer.

      – ffledgling
      Apr 30 '18 at 14:36






    • 1





      @ffledgling unix.stackexchange.com/q/92957/41104

      – Braiam
      Apr 30 '18 at 14:41
















    2














    You may need to build the tools since you are using a custom kernel. If you want to use linux tools from the repositories, you need to use the kernel provided by Ubuntu. Linux tools checks your kernel version and if it don't match it's own it will not run.






    share|improve this answer
























    • I see! I try to use perf in my original ubuntu kernel and it works. So isn't there any way to use perf in custom kernel?

      – user2002993
      Dec 26 '13 at 2:05













    • @user2002993 compile it yourself.

      – Braiam
      Mar 16 '14 at 17:14











    • @Braiam This is a very late comment, but would you mind adding some detail about where to find the source for linux-tools (eg. in the kernel source) and how to compile it? (eg. run make in linux/tools/perf) etc? I'd make for a more complete answer.

      – ffledgling
      Apr 30 '18 at 14:36






    • 1





      @ffledgling unix.stackexchange.com/q/92957/41104

      – Braiam
      Apr 30 '18 at 14:41














    2












    2








    2







    You may need to build the tools since you are using a custom kernel. If you want to use linux tools from the repositories, you need to use the kernel provided by Ubuntu. Linux tools checks your kernel version and if it don't match it's own it will not run.






    share|improve this answer













    You may need to build the tools since you are using a custom kernel. If you want to use linux tools from the repositories, you need to use the kernel provided by Ubuntu. Linux tools checks your kernel version and if it don't match it's own it will not run.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Dec 24 '13 at 16:28









    BraiamBraiam

    51.9k20136221




    51.9k20136221













    • I see! I try to use perf in my original ubuntu kernel and it works. So isn't there any way to use perf in custom kernel?

      – user2002993
      Dec 26 '13 at 2:05













    • @user2002993 compile it yourself.

      – Braiam
      Mar 16 '14 at 17:14











    • @Braiam This is a very late comment, but would you mind adding some detail about where to find the source for linux-tools (eg. in the kernel source) and how to compile it? (eg. run make in linux/tools/perf) etc? I'd make for a more complete answer.

      – ffledgling
      Apr 30 '18 at 14:36






    • 1





      @ffledgling unix.stackexchange.com/q/92957/41104

      – Braiam
      Apr 30 '18 at 14:41



















    • I see! I try to use perf in my original ubuntu kernel and it works. So isn't there any way to use perf in custom kernel?

      – user2002993
      Dec 26 '13 at 2:05













    • @user2002993 compile it yourself.

      – Braiam
      Mar 16 '14 at 17:14











    • @Braiam This is a very late comment, but would you mind adding some detail about where to find the source for linux-tools (eg. in the kernel source) and how to compile it? (eg. run make in linux/tools/perf) etc? I'd make for a more complete answer.

      – ffledgling
      Apr 30 '18 at 14:36






    • 1





      @ffledgling unix.stackexchange.com/q/92957/41104

      – Braiam
      Apr 30 '18 at 14:41

















    I see! I try to use perf in my original ubuntu kernel and it works. So isn't there any way to use perf in custom kernel?

    – user2002993
    Dec 26 '13 at 2:05







    I see! I try to use perf in my original ubuntu kernel and it works. So isn't there any way to use perf in custom kernel?

    – user2002993
    Dec 26 '13 at 2:05















    @user2002993 compile it yourself.

    – Braiam
    Mar 16 '14 at 17:14





    @user2002993 compile it yourself.

    – Braiam
    Mar 16 '14 at 17:14













    @Braiam This is a very late comment, but would you mind adding some detail about where to find the source for linux-tools (eg. in the kernel source) and how to compile it? (eg. run make in linux/tools/perf) etc? I'd make for a more complete answer.

    – ffledgling
    Apr 30 '18 at 14:36





    @Braiam This is a very late comment, but would you mind adding some detail about where to find the source for linux-tools (eg. in the kernel source) and how to compile it? (eg. run make in linux/tools/perf) etc? I'd make for a more complete answer.

    – ffledgling
    Apr 30 '18 at 14:36




    1




    1





    @ffledgling unix.stackexchange.com/q/92957/41104

    – Braiam
    Apr 30 '18 at 14:41





    @ffledgling unix.stackexchange.com/q/92957/41104

    – Braiam
    Apr 30 '18 at 14:41













    0














    On ubuntu "perf" is a shell script that calls a kernel specific perf binary.



    But that's not actually needed, perf is compatible. Just remove the wrapper from /usr/bin and copy any of the perf binaries from ./lib/linux-tools* to it.






    share|improve this answer




























      0














      On ubuntu "perf" is a shell script that calls a kernel specific perf binary.



      But that's not actually needed, perf is compatible. Just remove the wrapper from /usr/bin and copy any of the perf binaries from ./lib/linux-tools* to it.






      share|improve this answer


























        0












        0








        0







        On ubuntu "perf" is a shell script that calls a kernel specific perf binary.



        But that's not actually needed, perf is compatible. Just remove the wrapper from /usr/bin and copy any of the perf binaries from ./lib/linux-tools* to it.






        share|improve this answer













        On ubuntu "perf" is a shell script that calls a kernel specific perf binary.



        But that's not actually needed, perf is compatible. Just remove the wrapper from /usr/bin and copy any of the perf binaries from ./lib/linux-tools* to it.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jan 23 at 3:47









        prabha101prabha101

        1




        1






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Ask Ubuntu!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f395118%2fhow-to-install-perf-on-a-custom-build-kernel%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            How to reconfigure Docker Trusted Registry 2.x.x to use CEPH FS mount instead of NFS and other traditional...

            is 'sed' thread safe

            How to make a Squid Proxy server?