Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1664196
| Path | csiph.com!goblin1!goblin.stu.neva.ru!news.panservice.it!bofh.it!news.nic.it!robomod |
|---|---|
| From | Will Hawkins <whh8b@virginia.edu> |
| Newsgroups | linux.kernel |
| Subject | Ftrace vs perf user page fault statistics differences |
| Date | Mon, 12 Jun 2017 22:10:02 +0200 |
| Message-ID | <tRDOW-6O2-23@gated-at.bofh.it> (permalink) |
| Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=virginia-edu.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to:cc; bh=dsTHh7Ji63xvfiIRa1aH3JrEHyg7Nkny7/I+nqNpZi0=; b=ExtJ/G6RVKK0V/0562w3cu2S8ejE+WABHE0eicb9RRKLcC/s7Hg4FHDCMaMQEerBJM fDV+lB6BWeH9HMETolgOeIu0KAGf6FiCM7moLWSWxvVa5xl2jAHVylKlTgdck8L7yNdA 2a6DmAlCuuXn9nY/HWYqk1zCragPbpDbjGL1Y38aY3FnVE+kBoD2rgMz8jxwTK7OBp17 5Wp5SOGC9ChPoMth2sbyO1ZeQnLPcJr/HNCJ3jiHF1BtmmD5c5ziVN0l0RmO8KcN7fCs xVCshFTRPCbXTZlMGgHPw50MGB3r7Rqz7H6LDiSBrXLu4an052j1UieXLEbgrrtTCMGa E+Xw== |
| X-Google-Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=dsTHh7Ji63xvfiIRa1aH3JrEHyg7Nkny7/I+nqNpZi0=; b=n0omSUfrE2pyZjfi3Mhi1PruR4+aBZbYzmdWDYQcPVDcBqfCjGT5ZHa/4MX3QT2JiE Jngb92JgN1krn3lhmeZAX4GiPusK3XDITlV3oHZ9wSstbjhNlmY0bRHgiw3jG0S90yPs bUc7zZVhUZZ5v3ZV3HW+sdtn8zTUL02XhMe3TsMjRhAuDlORP4O/hC3RFdUMNAPm9Q5z zdDm+jzn+0ObTTZYwain3hD5nCpEjt+On8szhhfgoF4Woaw0aeFBul/Hb+XdKdyGp7mc S7c2N/QKZT15qyYDobeXn7nvgIh/KXtBtBP48C0jjQagqnjlhTyu1aPKz8yAcRZn7IZN MBPA== |
| X-Gm-Message-State | AKS2vOwrN0t+SVfhLsJ5EiZRYQI1p4r+JLMEPowkLv1qPuNWQW6QmmDx ODK5F99bvlXLvIr3L5+HLKmYz6fXdyLqmHM= |
| X-Received | by 10.200.43.24 with SMTP id 24mr10197451qtu.202.1497298129331; Mon, 12 Jun 2017 13:08:49 -0700 (PDT) |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset="UTF-8" |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 78 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | linux-kernel@vger.kernel.org |
| X-Original-Date | Mon, 12 Jun 2017 16:08:48 -0400 |
| X-Original-Message-ID | <CAE+MWFvLvx+GRLQ4ikSb94h1jVXwmFVb-3PCzFoqC7rnOb0rvw@mail.gmail.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1664196 |
Show key headers only | View raw
Dear Mr. Rostedt and Kernel community, I hope that this is an appropriate place to ask this question, Please forgive me for wasting your time if it is not. I've searched for answers to this question on LKML and the "net" before asking. I apologize if I already missed the question and answer somewhere else. I was doing a gut check of my understanding of how the Kernel pages in a binary program for execution. I created a very small program that is two pages. The entry point to the program is on page a and the code simply jumps to the second page (b) for its termination. I compiled the program and dropped the kernel's memory caches [1]. Then I ran the program under perf: perf record --call-graph fp -e page-faults ../one_page_play/page I looked at the results: perf report and the results were as I expected. There were two page faults for loading the code into memory and a page fault to copy_user_enhanced_fast_string invoked by execve's implementation when loading the binary. I decided to run the application under ftrace just for fun. I wanted an excuse to learn more about it and this seemed like the perfect chance. I used the incredible trace-cmd suite for the actual incantation of ftrace. I won't include the actual incantations here because I used many of them while digging around. The results are both expected and unexpected. I see output like this: Event: page_fault_user:0x4000e0 which indicates that there is a page fault at the program's entry point (and matches what I saw with the perf output). I have another similar entry that confirms the other expected page fault when loading the second page of the test application. However, I also see entries like this: Event: page_fault_user:0x7f4f590934c4 (1) The addresses of the faults I see that match that pattern are not loaded into the application binary. What I discovered as I investigated, is that those page faults seem to occur when the kernel is attempting to record the output of stack traces, etc. After thinking through this, I came up with the following hypothesis which is the crux of this email: Ftrace's act of recording the traces that I requested to its ring buffer generated page faults of their own. These page faults are generated on behalf of the traced program and get reported in the results. If that is correct/reasonable, it explains the differences between what perf is reporting and what ftrace is reporting and I am happy. If, however, that is a bogus conclusion, please help me understand what is going on. I know that everyone who is on this email is incredibly busy and has much to do. I hope that I've included enough information to make it possible for you experts to advise, but not included too much to waste your time. If you have the time or interest in answering, I would love to hear your responses. Please CC me directly on all responses. Thanks again for your time! Will [1] I used echo 3 > /proc/sys/vm/drop_caches to accomplish this and issued it between every run. It may have been overkill, but I did it anyway.
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
Ftrace vs perf user page fault statistics differences Will Hawkins <whh8b@virginia.edu> - 2017-06-12 22:10 +0200
Re: Ftrace vs perf user page fault statistics differences Steven Rostedt <rostedt@goodmis.org> - 2017-06-13 03:30 +0200
Re: Ftrace vs perf user page fault statistics differences Steven Rostedt <rostedt@goodmis.org> - 2017-06-13 15:10 +0200
Re: Ftrace vs perf user page fault statistics differences Will Hawkins <whh8b@virginia.edu> - 2017-06-13 20:10 +0200
Re: Ftrace vs perf user page fault statistics differences Steven Rostedt <rostedt@goodmis.org> - 2017-06-13 22:10 +0200
Re: Ftrace vs perf user page fault statistics differences Will Hawkins <whh8b@virginia.edu> - 2017-06-14 03:30 +0200
Re: Ftrace vs perf user page fault statistics differences Steven Rostedt <rostedt@goodmis.org> - 2017-06-14 04:20 +0200
Re: Ftrace vs perf user page fault statistics differences Will Hawkins <whh8b@virginia.edu> - 2017-06-14 19:50 +0200
Re: Ftrace vs perf user page fault statistics differences Steven Rostedt <rostedt@goodmis.org> - 2017-06-14 22:10 +0200
Re: Ftrace vs perf user page fault statistics differences Will Hawkins <whh8b@virginia.edu> - 2017-06-19 19:20 +0200
Re: Ftrace vs perf user page fault statistics differences Steven Rostedt <rostedt@goodmis.org> - 2017-06-19 21:00 +0200
Re: Ftrace vs perf user page fault statistics differences Namhyung Kim <namhyung@gmail.com> - 2017-06-14 05:10 +0200
Re: Ftrace vs perf user page fault statistics differences Will Hawkins <whh8b@virginia.edu> - 2017-06-14 19:40 +0200
Re: Ftrace vs perf user page fault statistics differences Steven Rostedt <rostedt@goodmis.org> - 2017-06-14 19:50 +0200
csiph-web