added my Recipes

This commit is contained in:
2024-07-11 14:16:35 +02:00
parent 38bc4f53ac
commit 09b621d929
7118 changed files with 525762 additions and 3 deletions

View File

@@ -0,0 +1,86 @@
From f62b629c1e1e968f90aafbc0cf9116b49eea9d8e Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sun, 15 Dec 2019 16:24:37 -0800
Subject: [PATCH] Include poll.h instead of sys/poll.h
Fixes
error: redirecting incorrect #include <sys/poll.h> to <poll.h> [-Werror,-W#warnings]
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
perf_examples/branch_smpl.c | 2 +-
perf_examples/syst_smpl.c | 2 +-
perf_examples/task_attach_timeout.c | 2 +-
perf_examples/task_smpl.c | 2 +-
perf_examples/x86/bts_smpl.c | 2 +-
5 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/perf_examples/branch_smpl.c b/perf_examples/branch_smpl.c
index 87cd303..4d16b04 100644
--- a/perf_examples/branch_smpl.c
+++ b/perf_examples/branch_smpl.c
@@ -32,7 +32,7 @@
#include <getopt.h>
#include <setjmp.h>
#include <sys/wait.h>
-#include <sys/poll.h>
+#include <poll.h>
#include <sys/mman.h>
#include <locale.h>
#include <sys/ioctl.h>
diff --git a/perf_examples/syst_smpl.c b/perf_examples/syst_smpl.c
index 04580fd..d059c08 100755
--- a/perf_examples/syst_smpl.c
+++ b/perf_examples/syst_smpl.c
@@ -33,7 +33,7 @@
#include <setjmp.h>
#include <sys/ptrace.h>
#include <sys/wait.h>
-#include <sys/poll.h>
+#include <poll.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <fcntl.h>
diff --git a/perf_examples/task_attach_timeout.c b/perf_examples/task_attach_timeout.c
index 7fc5524..a0367c8 100644
--- a/perf_examples/task_attach_timeout.c
+++ b/perf_examples/task_attach_timeout.c
@@ -36,7 +36,7 @@
#include <stdarg.h>
#include <sys/wait.h>
#include <err.h>
-#include <sys/poll.h>
+#include <poll.h>
#include "perf_util.h"
diff --git a/perf_examples/task_smpl.c b/perf_examples/task_smpl.c
index dcb7481..95c432c 100644
--- a/perf_examples/task_smpl.c
+++ b/perf_examples/task_smpl.c
@@ -37,7 +37,7 @@
#include <getopt.h>
#include <setjmp.h>
#include <sys/wait.h>
-#include <sys/poll.h>
+#include <poll.h>
#include <sys/mman.h>
#include <locale.h>
#include <sys/ioctl.h>
diff --git a/perf_examples/x86/bts_smpl.c b/perf_examples/x86/bts_smpl.c
index 6498776..d66d5e6 100644
--- a/perf_examples/x86/bts_smpl.c
+++ b/perf_examples/x86/bts_smpl.c
@@ -41,7 +41,7 @@
#include <sys/time.h>
#include <sys/ptrace.h>
#include <sys/wait.h>
-#include <sys/poll.h>
+#include <poll.h>
#include <sys/mman.h>
#include <sys/resource.h>
#include <err.h>
--
2.24.1

View File

@@ -0,0 +1,44 @@
From 0b2f611a95f3c93454453892bbe021ad2815925d Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Tue, 15 Jun 2021 17:35:26 -0700
Subject: [PATCH] perf_examples: Remove unused 'sum' variable
Fixes
self_smpl_multi.c:144:19: error: variable 'sum' set but not used [-Werror,-Wunused-but-set-variable]
unsigned long x, sum;
^
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
perf_examples/self_smpl_multi.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/perf_examples/self_smpl_multi.c b/perf_examples/self_smpl_multi.c
index 391fa61..75b45e0 100644
--- a/perf_examples/self_smpl_multi.c
+++ b/perf_examples/self_smpl_multi.c
@@ -141,7 +141,7 @@ void
do_cycles(void)
{
struct timeval start, last, now;
- unsigned long x, sum;
+ unsigned long x;
gettimeofday(&start, NULL);
last = start;
@@ -150,15 +150,12 @@ do_cycles(void)
iter[myid] = 0;
do {
-
- sum = 1;
for (x = 1; x < 250000; x++) {
/* signal pending to private queue because of
* pthread_kill(), i.e., tkill()
*/
if ((x % 5000) == 0)
pthread_kill(pthread_self(), SIGUSR1);
- sum += x;
}
iter[myid]++;