Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-1.1
Commits
6c9e6221
Commit
6c9e6221
authored
Jun 07, 2010
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only print the first 5 threading errors each
(cherry picked from commit
2dde53c5
) Conflicts: bin/override.c
parent
fdfc6926
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
11 deletions
+22
-11
bin/override.c
bin/override.c
+22
-11
No files found.
bin/override.c
View file @
6c9e6221
...
...
@@ -23,6 +23,7 @@
#endif
#include <stdbool.h>
#define MAX_ERRORS 5
void
vlc_enable_override
(
void
);
...
...
@@ -55,32 +56,37 @@ void vlc_enable_override (void)
pthread_atfork
(
NULL
,
NULL
,
vlc_reset_override
);
}
static
void
vlogbug
(
const
char
*
level
,
const
char
*
func
,
const
char
*
fmt
,
va_list
ap
)
static
void
vlogbug
(
unsigned
*
pc
,
const
char
*
level
,
const
char
*
func
,
const
char
*
fmt
,
va_list
ap
)
{
#ifdef HAVE_BACKTRACE
const
size_t
framec
=
4
;
const
size_t
framec
=
5
;
void
*
framev
[
framec
];
backtrace
(
framev
,
framec
);
#endif
flockfile
(
stderr
);
fprintf
(
stderr
,
"%s: call to %s("
,
level
,
func
);
vfprintf
(
stderr
,
fmt
,
ap
);
fputs
(
")
\n
"
,
stderr
);
fflush
(
stderr
);
if
(
*
pc
<
MAX_ERRORS
)
{
(
*
pc
)
++
;
fprintf
(
stderr
,
"%s: call to %s("
,
level
,
func
);
vfprintf
(
stderr
,
fmt
,
ap
);
fputs
(
")
\n
"
,
stderr
);
fflush
(
stderr
);
#ifdef HAVE_BACKTRACE
backtrace_symbols_fd
(
framev
+
2
,
framec
-
2
,
fileno
(
stderr
));
backtrace_symbols_fd
(
framev
+
2
,
framec
-
2
,
fileno
(
stderr
));
#endif
}
funlockfile
(
stderr
);
}
static
void
logbug
(
const
char
*
level
,
const
char
*
func
,
const
char
*
fmt
,
...)
static
void
logbug
(
unsigned
*
pc
,
const
char
*
level
,
const
char
*
func
,
const
char
*
fmt
,
...)
{
va_list
ap
;
va_start
(
ap
,
fmt
);
vlogbug
(
level
,
func
,
fmt
,
ap
);
vlogbug
(
pc
,
level
,
func
,
fmt
,
ap
);
va_end
(
ap
);
}
...
...
@@ -96,7 +102,12 @@ static void *getsym (const char *name)
return
sym
;
}
#define LOG(level, ...) logbug(level, __func__, __VA_ARGS__)
#define LOG(level, ...) \
do { \
static unsigned counter = 0; \
logbug(&counter, level, __func__, __VA_ARGS__); \
} while (0)
#define CALL(func, ...) \
({ typeof (func) *sym = getsym ( # func); sym (__VA_ARGS__); })
...
...
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