Skip to content

Commit f79974e

Browse files
author
Patrick Titiano
committed
first release
First public release. Signed-off-by: Patrick Titiano <[email protected]>
1 parent 8c40f19 commit f79974e

10 files changed

+1882
-3
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# CPULoadGen Output Binary
2+
cpuloadgen
3+
14
# Object files
25
*.o
36

CREDITS

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
###############################################################################
2+
# #
3+
# CREDITS #
4+
# #
5+
###############################################################################
6+
7+
This is at least a partial credits-file of people that have
8+
contributed to the CPULOADGEN project. It is sorted by name and
9+
formatted to allow easy grepping and beautification by
10+
scripts. The fields are: name (N), email (E), web-address
11+
(W), PGP key ID and fingerprint (P), description (D), and
12+
snail-mail address (S).
13+
----------
14+
15+
N: Nishanth Menon
16+
17+
D: misc. bug fixes
18+
S: USA
19+
20+
N: Patrick Titiano
21+
22+
D: initiator
23+
D: main developer
24+
D: maintainer
25+
S: France

LICENSE

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
###############################################################################
2+
# #
3+
# CPULOADGEN LICENSE #
4+
# #
5+
# Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/ #
6+
# #
7+
###############################################################################
8+
9+
10+
All files are published under the terms of the BSD License.
11+
12+
Redistribution and use in source and binary forms, with or without
13+
modification, are permitted provided that the following conditions
14+
are met:
15+
16+
Redistributions of source code must retain the above copyright
17+
notice, this list of conditions and the following disclaimer.
18+
19+
Redistributions in binary form must reproduce the above copyright
20+
notice, this list of conditions and the following disclaimer in the
21+
documentation and/or other materials provided with the
22+
distribution.
23+
24+
Neither the name of Texas Instruments Incorporated nor the names of
25+
its contributors may be used to endorse or promote products derived
26+
from this software without specific prior written permission.
27+
28+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
31+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
32+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
33+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
34+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
35+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
36+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
38+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

MAINTAINERS

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
###############################################################################
2+
# #
3+
# List of maintainers #
4+
# #
5+
###############################################################################
6+
7+
Descriptions of section entries:
8+
9+
P: Person (obsolete)
10+
M: Mail patches to: FullName <address@domain>
11+
L: Mailing list that is relevant to this area
12+
W: Web-page with status/info
13+
Q: Patchwork web based patch tracking system site
14+
T: SCM tree type and location. Type is one of: git, hg, quilt, stgit.
15+
S: Status, one of the following:
16+
Supported: Someone is actually paid to look after this.
17+
Maintained: Someone actually looks after it.
18+
Odd Fixes: It has a maintainer but they don't have time to do
19+
much other than throw the odd patch in. See below..
20+
Orphan: No current maintainer [but maybe you could take the
21+
role as you write your new code].
22+
Obsolete: Old code. Something tagged obsolete generally means
23+
it has been replaced by a better system and you
24+
should be using that.
25+
F: Files and directories with wildcard patterns.
26+
A trailing slash includes all files and subdirectory files.
27+
F: drivers/net/ all files in and below drivers/net
28+
F: drivers/net/* all files in drivers/net, but not below
29+
F: */net/* all files in "any top level directory"/net
30+
One pattern per line. Multiple F: lines acceptable.
31+
X: Files and directories that are NOT maintained, same rules as F:
32+
Files exclusions are tested before file matches.
33+
Can be useful for excluding a specific subdirectory, for instance:
34+
F: net/
35+
X: net/ipv6/
36+
matches all files in and below net excluding net/ipv6/
37+
K: Keyword perl extended regex pattern to match content in a
38+
patch or file. For instance:
39+
K: of_get_profile
40+
matches patches or files that contain "of_get_profile"
41+
K: \b(printk|pr_(info|err))\b
42+
matches patches or files that contain one or more of the words
43+
printk, pr_info or pr_err
44+
One regex pattern per line. Multiple K: lines acceptable.
45+
46+
Note: For the hard of thinking, this list is meant to remain in alphabetical
47+
order.
48+
49+
Maintainers List (try to look for most precise areas first)
50+
51+
-----------------------------------
52+
53+
Maintenance
54+
M: Patrick Titiano ([email protected])
55+
56+
S: Supported
57+
F: *

Makefile

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
#/*
2+
# *
3+
# * @Component CPULOADGEN
4+
# * @Filename Makefile
5+
# * @Description Makefile for cpuloadgen
6+
# * @Author Patrick Titiano ([email protected])
7+
# * @Date 2010
8+
# * @Copyright Texas Instruments Incorporated
9+
# *
10+
# *
11+
# * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
12+
# *
13+
# *
14+
# * Redistribution and use in source and binary forms, with or without
15+
# * modification, are permitted provided that the following conditions
16+
# * are met:
17+
# *
18+
# * Redistributions of source code must retain the above copyright
19+
# * notice, this list of conditions and the following disclaimer.
20+
# *
21+
# * Redistributions in binary form must reproduce the above copyright
22+
# * notice, this list of conditions and the following disclaimer in the
23+
# * documentation and/or other materials provided with the
24+
# * distribution.
25+
# *
26+
# * Neither the name of Texas Instruments Incorporated nor the names of
27+
# * its contributors may be used to endorse or promote products derived
28+
# * from this software without specific prior written permission.
29+
# *
30+
# * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
31+
# * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
32+
# * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
33+
# * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
34+
# * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
35+
# * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
36+
# * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
37+
# * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
38+
# * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
39+
# * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
40+
# * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
41+
# *
42+
# */
43+
44+
45+
CC = $(CROSS_COMPILE)gcc
46+
MYCFLAGS += -Wall -static
47+
DESTDIR = ./out
48+
49+
objects = cpuloadgen.o timers_b.o dhry_21b.o
50+
51+
cpuloadgen: $(objects) builddate.o dhry.h
52+
$(CC) $(MYCFLAGS) -o cpuloadgen $(objects) builddate.o
53+
rm builddate.c
54+
55+
builddate.c: $(objects)
56+
echo 'char *builddate="'`date`'";' > builddate.c
57+
58+
install: cpuloadgen
59+
install -d $(DESTDIR)
60+
install cpuloadgen $(DESTDIR)
61+
62+
clean:
63+
rm -f cpuloadgen $(objects) builddate.o builddate.c

README.md

+76-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,77 @@
1-
cpuloadgen
2-
==========
1+
###############################################################################
2+
# #
3+
# CPULOADGEN #
4+
# #
5+
# A Programmable CPU Load Generator, based on Dhrystone loops #
6+
###############################################################################
37

4-
CPU Load Generator
8+
9+
10+
ABOUT:
11+
------
12+
13+
CPULOADGEN is a Linux user-space standalone application designed to provide a
14+
quick'n easy way to generate programmable load on CPU core(s).
15+
16+
To generate load, it reuses DHRYSTONE loops, applying on top of it sort of
17+
PWM (Pulse Width Modulation) principle: by generating active (100% load) and
18+
idle (0% load) with programmable duty cycle,
19+
it generates an average CPU load of [1-100]%.
20+
.
21+
22+
23+
SUPPORT:
24+
--------
25+
CPULOADGEN is a generic application, it can run on any CPU architecture.
26+
27+
Please note however that application development is still under progress,
28+
so currently it can only generates loads on mono or dual-core architectures
29+
(extra cores will not be handled). This will be improved to address any number of
30+
CPU cores in the future.
31+
32+
33+
THIS SOFTWARE IS PROVIDED AS IS, WITH NO SUPPORT OR MAINTENANCE COMMITMENT FROM
34+
TEXAS INSTRUMENTS INCORPORATED.
35+
36+
37+
38+
Build instructions:
39+
-------------------
40+
To only build the output binary file:
41+
42+
# make cpuloadgen
43+
44+
NB: CROSS_COMPILE variable must be set to point to the correct compiler.
45+
E.g: (for ARM architecture)
46+
47+
# export CROSS_COMPILE=arm-none-linux-gnueabi-
48+
49+
or
50+
51+
# make CROSS_COMPILE=arm-none-linux-gnueabi- cpuloadgen
52+
53+
54+
To build and install cpuloadgen:
55+
56+
# make DESTDIR=<YOUR_DIR> install
57+
58+
<YOUR_DIR> is a destination directory where cpuloadgen output binary file will be
59+
installed (copied, e.g. ubuntu/android filesystem).
60+
61+
That's it!
62+
63+
64+
65+
Usage:
66+
-----
67+
68+
cpuloadgen [<cpu0load>] [<cpu1load>] [<duration>]
69+
<cpu0load>: CPU load to be generated on CPU0 (in %) [1-100]
70+
<cpu1load>: CPU load to be generated on CPU1 (in %) [1-100]
71+
<duration>: test duration (in seconds) [0-600]
72+
73+
If <duration> is omitted, then it runs until CTRL+C is pressed.
74+
If <duration> & <cpu1load> are omitted, then it generates <cpu0load> load on any
75+
available CPU until CTRL+C is pressed (no affinity, scheduler runtime decision).
76+
If all options are omitted, then it runs until CTRL+C is pressed with
77+
a 100% CPU Load on each core.

0 commit comments

Comments
 (0)