Skip to content

Instantly share code, notes, and snippets.

View kiryl's full-sized avatar

Kirill A. Shutemov kiryl

View GitHub Profile
-> Israel
-> Mideast/Riyadh89
zzz
-> Mideast/Riyadh88
zzz
-> Mideast/Riyadh87
zzz
-> GMT+0
-> Zulu
-> Israel
-> Mideast/Riyadh89
zzz
-> Mideast/Riyadh88
zzz
-> Mideast/Riyadh87
zzz
-> GMT+0
-> Zulu
UTC
@kiryl
kiryl / gist:4428902
Last active December 10, 2015 11:39
var
i : integer;
inf, post : string;
stack : array[1..255] of char;
top : integer;
procedure die(error: string);
begin
writeln(error);
diff --git a/lib/decompress_unlzma.c b/lib/decompress_unlzma.c
index 32adb73..77c7d26 100644
--- a/lib/decompress_unlzma.c
+++ b/lib/decompress_unlzma.c
@@ -36,6 +36,7 @@
#endif /* STATIC */
#include <linux/decompress/mm.h>
+#include <linux/sched.h>
library FuncLib;
uses Math;
function fact(n : double) : double;
begin
fact := 1;
if n > 0 then
fact := fact(n - 1) * n;
end;
program Sort;
var
arr : array[0..10] of integer;
i, cmp : integer;
{ insert sort }
procedure InsSort (var arr : array of integer);
var i, j : integer;
begin
diff --git a/tools/perf/bench/mem-memcpy.c b/tools/perf/bench/mem-memcpy.c
index 93c83e3..0689b7b 100644
--- a/tools/perf/bench/mem-memcpy.c
+++ b/tools/perf/bench/mem-memcpy.c
@@ -17,6 +17,7 @@
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
+#include <sys/prctl.h>
#include <errno.h>
# echo never > /sys/kernel/mm/transparent_hugepage/enabled
# ./perf stat -D -e L1-dcache-loads -e L1-dcache-load-misses -e L1-dcache-stores -e L1-dcache-store-misses -e L1-dcache-prefetches -e L1-dcache-prefetch-misses -e LLC-loads -e LLC-load-misses -e LLC-stores -e LLC-store-misses -e LLC-prefetches -e LLC-prefetch-misses ./perf bench mem memcpy -o -l 5gb
# Running mem/memcpy benchmark...
# Copying 5gb Bytes ...
3.245643 GB/Sec (with prefault)
Performance counter stats for './perf bench mem memcpy -o -l 5gb':
755494274 L1-dcache-loads [25.16%]
@kiryl
kiryl / gist:5720913
Last active December 18, 2015 03:49
diff --git a/tools/perf/bench/mem-memcpy.c b/tools/perf/bench/mem-memcpy.c
index 93c83e3..b204101 100644
--- a/tools/perf/bench/mem-memcpy.c
+++ b/tools/perf/bench/mem-memcpy.c
@@ -17,6 +17,7 @@
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
+#include <sys/prctl.h>
#include <errno.h>
[ 147.972857] ------------[ cut here ]------------
[ 147.973540] WARNING: CPU: 0 PID: 892 at /home/space/kas/git/public/linux-next/drivers/gpu/drm/i915/intel_display.c:8286 check_crtc_state+0x56f/0x990()
[ 147.974297] pipe state doesn't match!
[ 147.975014] Modules linked in:
[ 147.975737] CPU: 0 PID: 892 Comm: kworker/u16:5 Not tainted 3.10.0-rc6-next-20130618+ #37
[ 147.976512] Hardware name: Acer Aspire S5-391/Venus , BIOS V1.09 11/29/2012
[ 147.977332] Workqueue: i915 i915_hotplug_work_func
[ 147.978118] 0000000000000009 ffff8801622a78d0 ffffffff81770e7c ffff8801622a7918
[ 147.978962] ffff8801622a7908 ffffffff810396c3 ffff8801622a7990 ffff8801698d3800
[ 147.979804] ffff88016958a6c8 ffff88016958a000 ffff8801698d3c78 ffff8801622a7968