Tiny Core Linux
Tiny Core Extensions => TCE Talk => Topic started by: manit123 on November 23, 2013, 01:00:34 AM
-
It seems that it may be overheating because same effects were observed in windows xp on same computer.
So I tried to use cpulimit in linux
Compilation gave following error
$ gcc -o cpulimit cpulimit.c
/tmp/ccOmXgMd.o: In function `compute_cpu_usage':
cpulimit.c:(.text+0x72f): undefined reference to `clock_gettime'
/tmp/ccOmXgMd.o: In function `main':
cpulimit.c:(.text+0x13c4): undefined reference to `clock_gettime'
cpulimit.c:(.text+0x13ec): undefined reference to `clock_gettime'
see attached code for further details (537lines)
-
Hi manit123
What happens if you do:
gcc -o cpulimit cpulimit.c -lrt
-
$ tce-load -wi gcc.tcz
libmpc.tcz.dep OK
mpfr.tcz.dep OK
Downloading: gmp.tcz
Connecting to repo.tinycorelinux.net (89.22.99.37:80)
gmp.tcz 100% |*******************************| 292k 0:00:00 ETA
gmp.tcz: OK
Downloading: mpfr.tcz
Connecting to repo.tinycorelinux.net (89.22.99.37:80)
mpfr.tcz 100% |*******************************| 180k 0:00:00 ETA
mpfr.tcz: OK
Downloading: libmpc.tcz
Connecting to repo.tinycorelinux.net (89.22.99.37:80)
libmpc.tcz 100% |*******************************| 45056 0:00:00 ETA
libmpc.tcz: OK
Downloading: binutils.tcz
Connecting to repo.tinycorelinux.net (89.22.99.37:80)
binutils.tcz 100% |*******************************| 2164k 0:00:00 ETA
binutils.tcz: OK
Downloading: gcc_libs.tcz
Connecting to repo.tinycorelinux.net (89.22.99.37:80)
gcc_libs.tcz 100% |*******************************| 304k 0:00:00 ETA
gcc_libs.tcz: OK
Downloading: gcc.tcz
Connecting to repo.tinycorelinux.net (89.22.99.37:80)
gcc.tcz 100% |*******************************| 17224k 0:00:00 ETA
gcc.tcz: OK
tc@box:/tmp/tce/optional$ tce-load -wi make.tcz
Downloading: make.tcz
Connecting to repo.tinycorelinux.net (89.22.99.37:80)
make.tcz 100% |*******************************| 90112 0:00:00 ETA
make.tcz: OK
$ cd ~/cpulimit-1.1/
$make
gcc -o cpulimit cpulimit.c -lrt -Wall -O2
cpulimit.c:32:20: fatal error: getopt.h: No such file or directory
compilation terminated.
make: *** [cpulimit] Error 1
$ gcc -o cl cpulimit.c -lrt
cpulimit.c:32:20: fatal error: getopt.h: No such file or directory
compilation terminated.
-
You need to load compiletc rather than gcc
-
that helped.
Mark this thread as solved.
-
Hi manit123
Mark this thread as solved.
It is the responsibility of the person who started the thread to mark it as solved. Go to the original post, click Modify, and
add [SOLVED] to the subject line.
-
A cpulimit extension may be a welcomed contribution to repo.
-
Sorry for my late reply.
I have noticed ffmpeg taking > 80% CPU time in 'top' results.
The compiled binary gave 'segmentation fault' in all trials (run as root , use pid , use process name , launch process with cpulimit) as suggested at http://cpulimit.sourceforge.net/.
You can try it yourself .
-
I have noticed ffmpeg taking > 80% CPU time in 'top' results.
What do you mean? CPU percentage vs. CPU time values are distinct.
The compiled binary gave 'segmentation fault' in all trials
Which process segfaults, ffmpeg or cputime?
-
Here is stacktrace of cpulimit
$ gdb cpulimit
GNU gdb (GDB) 7.2
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/tc/cpulimit-old/cpulimit-1.1/cpulimit...(no debugging symbols found)...done.
(gdb) run --limit 40 ffmpeg -i '/mnt/sda3/recent/video/Badminton Men_s Singles Final - Malaysia Vs China at London 2012 Olympic Games.mp4' -vcodec libx264 -acodec libmp3lame /mnt/sda3/recent/video/mmfs-old.mp4
Starting program: /home/tc/cpulimit-old/cpulimit-1.1/cpulimit --limit 40 ffmpeg -i '/mnt/sda3/recent/video/Badminton Men_s Singles Final - Malaysia Vs China at London 2012 Olympic Games.mp4' -vcodec libx264 -acodec libmp3lame /mnt/sda3/recent/video/mmfs-old.mp4
warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available.
Program received signal SIGSEGV, Segmentation fault.
0xb761ce42 in ?? () from /lib/libc.so.6
(gdb) bt
#0 0xb761ce42 in ?? () from /lib/libc.so.6
#1 0xb761cc92 in strtol () from /lib/libc.so.6
#2 0x08048b26 in main ()
If you get latest svn . Then it works.
If I want to create extension of this program.
I know two ways
(1)make a tcz which just contains compiled i386 binary in /bin folder. Easy . I somehow forgot - how to do this ? (I had created a oxford tcz after I managed to install application from my CD )
(2)Dependency will be compiletc.tcz & svn. Then script should download latest code by running
$svn checkout https://svn.code.sf.net/p/cpulimit/code/trunk cpulimit
because
$ svn checkout https://cpulimit.svn.sourceforge.net/svnroot/cpulimit/trunk cpulimit
svn: Repository moved permanently to 'https://svn.code.sf.net/p/cpulimit/code/trunk'; please relocate
This will create folder cpulimit containing following files
Makefile cpulimit.c list.h process.h procutils.h
README list.c process.c procutils.c
Now run
$cd cpulimit ; make ; sudo cp cpulimit /bin
This is better as it compiles binary according to user processor.
But , this heavy on requirement & after reading https://code.google.com/p/tcztools/ -> I am still confused.