Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PoroCYon
pimpmobile
Commits
b9a56625
Commit
b9a56625
authored
Nov 03, 2009
by
Erik Faye-Lund
Browse files
move testbench to t
parent
589038e7
Changes
18
Hide whitespace changes
Inline
Side-by-side
.gitignore
View file @
b9a56625
...
@@ -9,5 +9,4 @@ examples/sample_bank.bin
...
@@ -9,5 +9,4 @@ examples/sample_bank.bin
examples/data/*.bin
examples/data/*.bin
*.o
*.o
*.d
*.d
testbench/unit_test.exe
t/*.exe
testbench/dump_render.exe
Makefile
View file @
b9a56625
...
@@ -169,7 +169,7 @@ distclean:
...
@@ -169,7 +169,7 @@ distclean:
$(RM)
-r
$(BUILD_DIR)
$(RM)
-r
$(BUILD_DIR)
check
:
check
:
$(MAKE)
-C
t
estbench
run
$(MAKE)
-C
t run
check-syntax
:
check-syntax
:
$(TARGET_CC)
$(CPPFLAGS)
$(TARGET_CPPFLAGS)
$(CFLAGS)
-fsyntax-only
$(
filter
%.c,
$(SOURCES)
)
$(TARGET_CC)
$(CPPFLAGS)
$(TARGET_CPPFLAGS)
$(CFLAGS)
-fsyntax-only
$(
filter
%.c,
$(SOURCES)
)
...
...
profiling/cyg-profile.c
deleted
100644 → 0
View file @
589038e7
/*
* cyg-profile.c - CygProfiler runtime functions.
*
* Michal Ludvig <michal@logix.cz>
* http://www.logix.cz/michal/devel
*
* cyg-profile.c
* - Compile your program with -finstrument-functions and link
* together with this code.
* - Logging is enabled as soon as your program calls
* cygprofile_enable() and disabled with cygprofile_disable().
* - Before logging was enabled you can change the name
* of a logfile by calling cygprofile_setfilename().
*/
/* Hint: -finstrument-functions, no_instrument_function */
#include <errno.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include "cyg-profile.h"
#define FN_SIZE 100
#define FN_DEFAULT "cyglog.%d"
/* Private variables. */
static
int
level
=
0
;
// static FILE *logfile=NULL;
static
FILE
*
logfile
=
NULL
;
static
int
cyg_profile_enabled
=
1
;
static
char
cyg_profile_filename
[
FN_SIZE
+
1
];
#ifdef __cplusplus
extern
"C"
{
#endif
/* Static functions. */
static
FILE
*
openlogfile
(
const
char
*
filename
)
__attribute__
((
no_instrument_function
));
static
void
closelogfile
(
void
)
__attribute__
((
no_instrument_function
));
/* Note that these are linked internally by the compiler.
* Don't call them directly! */
void
__cyg_profile_func_enter
(
void
*
this_fn
,
void
*
call_site
)
__attribute__
((
no_instrument_function
));
void
__cyg_profile_func_exit
(
void
*
this_fn
,
void
*
call_site
)
__attribute__
((
no_instrument_function
));
#ifdef __cplusplus
};
#endif
#include <mappy.h>
/* #include <xcomms.h> */
/* #include <mbv2.h> */
static
void
print
(
char
*
str
)
{
#if 1
dprintf
(
str
);
#else
asm
volatile
(
"mov r0, %0
\n
"
#ifdef __thumb__
"swi 0xff
\n
"
#else
"swi 0xff << 16
\n
"
#endif
:
// no ouput
:
"r"
(
str
)
:
"r0"
,
"r1"
,
"r2"
);
#endif
}
void
__cyg_profile_func_enter
(
void
*
this_fn
,
void
*
call_site
)
{
if
(
cyg_profile_enabled
)
{
char
temp
[
256
];
sprintf
(
temp
,
"+ %d %p %p
\n
"
,
level
++
,
this_fn
,
call_site
);
print
(
temp
);
}
}
void
__cyg_profile_func_exit
(
void
*
this_fn
,
void
*
call_site
)
{
if
(
cyg_profile_enabled
)
{
char
temp
[
256
];
sprintf
(
temp
,
"- %d %p %p
\n
"
,
level
--
,
this_fn
,
call_site
);
print
(
temp
);
}
}
void
cygprofile_enable
(
void
)
{
if
(
!
cyg_profile_filename
[
0
])
cygprofile_setfilename
(
FN_DEFAULT
);
if
(
!
openlogfile
(
cyg_profile_filename
))
return
;
cyg_profile_enabled
=
1
;
}
void
cygprofile_disable
(
void
)
{
cyg_profile_enabled
=
0
;
}
int
cygprofile_isenabled
(
void
)
{
return
cyg_profile_enabled
;
}
int
cygprofile_setfilename
(
const
char
*
filename
)
{
char
*
ptr
;
if
(
cygprofile_isenabled
())
return
-
1
;
if
(
strlen
(
filename
)
>
FN_SIZE
)
return
-
2
;
ptr
=
strstr
(
filename
,
"%d"
);
if
(
ptr
)
{
size_t
len
;
len
=
ptr
-
filename
;
snprintf
(
cyg_profile_filename
,
len
+
1
,
"%s"
,
filename
);
snprintf
(
&
cyg_profile_filename
[
len
],
FN_SIZE
-
len
,
"%d"
,
getpid
());
len
=
strlen
(
cyg_profile_filename
);
snprintf
(
&
cyg_profile_filename
[
len
],
FN_SIZE
-
len
,
"%s"
,
ptr
+
2
);
}
else
snprintf
(
cyg_profile_filename
,
FN_SIZE
,
"%s"
,
filename
);
if
(
logfile
)
closelogfile
();
return
0
;
}
char
*
cygprofile_getfilename
(
void
)
{
if
(
!
cyg_profile_filename
[
0
])
cygprofile_setfilename
(
FN_DEFAULT
);
return
cyg_profile_filename
;
}
static
FILE
*
openlogfile
(
const
char
*
filename
)
{
static
int
complained
=
0
;
FILE
*
file
;
if
(
complained
)
return
NULL
;
if
(
logfile
)
return
logfile
;
file
=
fopen
(
filename
,
"w"
);
if
(
!
file
)
{
fprintf
(
stderr
,
"WARNING: Can't open logfile '%s': %s
\n
"
,
filename
,
strerror
(
errno
));
complained
=
1
;
return
NULL
;
}
setlinebuf
(
file
);
logfile
=
file
;
return
file
;
}
static
void
closelogfile
(
void
)
{
if
(
logfile
)
fclose
(
logfile
);
}
profiling/cyg-profile.h
deleted
100644 → 0
View file @
589038e7
/*
* cyg-profile.h - Header file for CygProfiler
*
* Michal Ludvig <michal@logix.cz>
* http://www.logix.cz/michal/devel
*
* This source code is a public domain.
*
* See cyg-profile.c for details on usage.
*/
#ifndef CYG_PROFILE_H
#define CYG_PROFILE_H
/* Public functions. */
#ifdef __cplusplus
extern
"C"
{
#endif
/* Enable/disable CygProfiler. */
void
cygprofile_enable
(
void
)
__attribute__
((
no_instrument_function
));
void
cygprofile_disable
(
void
)
__attribute__
((
no_instrument_function
));
/* Tell whether CygProfiler is enabled/disabled. */
int
cygprofile_isenabled
(
void
)
__attribute__
((
no_instrument_function
));
/* Set filename of a logfile. */
int
cygprofile_setfilename
(
const
char
*
filename
)
__attribute__
((
no_instrument_function
));
/* Query for a filename of a logfile. */
char
*
cygprofile_getfilename
(
void
)
__attribute__
((
no_instrument_function
));
#ifdef __cplusplus
};
#endif
#endif
t
estbench
/Makefile
→
t/Makefile
View file @
b9a56625
File moved
t
estbench
/framework/selftest.c
→
t/framework/selftest.c
View file @
b9a56625
File moved
t
estbench
/framework/test_framework.c
→
t/framework/test_framework.c
View file @
b9a56625
File moved
t
estbench
/framework/test_framework.h
→
t/framework/test_framework.h
View file @
b9a56625
File moved
t
estbench
/framework/test_helpers.c
→
t/framework/test_helpers.c
View file @
b9a56625
File moved
t
estbench
/framework/test_helpers.h
→
t/framework/test_helpers.h
View file @
b9a56625
File moved
t
estbench
/framework/test_suite.c
→
t/framework/test_suite.c
View file @
b9a56625
File moved
t
estbench
/framework/test_suite.h
→
t/framework/test_suite.h
View file @
b9a56625
File moved
t
estbench
/toplevel/dump_render.c
→
t/toplevel/dump_render.c
View file @
b9a56625
File moved
t
estbench
/toplevel/env_sustain.xm
→
t/toplevel/env_sustain.xm
View file @
b9a56625
File moved
t
estbench
/toplevel/ins_fadeout.xm
→
t/toplevel/ins_fadeout.xm
View file @
b9a56625
File moved
t
estbench
/unit/test_mixer.c
→
t/unit/test_mixer.c
View file @
b9a56625
File moved
t
estbench
/unit/test_serializer.c
→
t/unit/test_serializer.c
View file @
b9a56625
File moved
t
estbench
/unit_test.c
→
t/unit_test.c
View file @
b9a56625
File moved
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment