Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
lektor
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Compilation
Pipelines
Jobs
Planifications de pipeline
Artéfacts
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté GitLab
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
Kubat
lektor
Validations
ac430e64
Vérifiée
Valider
ac430e64
rédigé
Il y a 5 ans
par
Kubat
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
Introduce log macros (heavy, but for simple use)
parent
d8a8f409
Aucune branche associée trouvée
Aucune étiquette associée trouvée
1 requête de fusion
!67
Resolve "Thread pool"
Modifications
2
Afficher les modifications d'espaces
En ligne
Côte à côte
Affichage de
2 fichiers modifiés
inc/common/macro.h
+19
-0
19 ajouts, 0 suppression
inc/common/macro.h
src/mthread/mthread.c
+2
-2
2 ajouts, 2 suppressions
src/mthread/mthread.c
avec
21 ajouts
et
2 suppressions
inc/common/macro.h
+
19
−
0
Voir le fichier @
ac430e64
...
...
@@ -32,3 +32,22 @@
ret = str == NULL ? 0 : strtol(str, &(endptr), 0); \
err_flag = errno != 0 || endptr == str; \
}
#define ERROR 1
#define WARN 2
#define INFO 3
#define DEBUG 4
#define LOG(format, level, section, ...) \
fprintf(stderr, " %c %s %s:" format "\n", \
level == ERROR ? '!' : level == WARN ? '*' : level == INFO ? '.' : ' ', \
__func__, \
section ? "[" section "]" : "", \
__VA_ARGS__)
#define LOG_INFO_SCT(section, format, ...) LOG(format, INFO, section, __VA_ARGS__)
#define LOG_WARN_SCT(section, format, ...) LOG(format, WARN, section, __VA_ARGS__)
#define LOG_ERROR_SCT(section, format, ...) LOG(format, ERROR, section, __VA_ARGS__)
#define LOG_DEBUG_SCT(section, format, ...) LOG(format, DEBUG, section, __VA_ARGS__)
#define LOG_INFO(format, ...) LOG_INFO_SCT(format, NULL, __VA_ARGS__)
#define LOG_WARN(format, ...) LOG_WARN_SCT(format, NULL, __VA_ARGS__)
#define LOG_ERROR(format, ...) LOG_DEBUG_SCT(format, NULL, __VA_ARGS__)
#define LOG_DEBUG(format, ...) LOG_DEBUG_SCT(format, NULL, __VA_ARGS__)
Ce diff est replié.
Cliquez pour l'agrandir.
src/mthread/mthread.c
+
2
−
2
Voir le fichier @
ac430e64
...
...
@@ -145,7 +145,7 @@ mthread_work_take(mthread_virtual_processor_t *vp)
tmp
=
mthread_remove_first
(
&
(
virtual_processors
[
i
].
ready_list
));
}
if
(
tmp
!=
NULL
)
{
fprintf
(
stderr
,
" *
LOAD BALANCE, Work %p from %d to %d
\n
"
,
(
void
*
)
tmp
,
i
,
vp
->
rank
);
LOG_INFO_SCT
(
"
LOAD BALANCE
"
,
"
Work %p from %d to %d"
,
(
void
*
)
tmp
,
i
,
vp
->
rank
);
return
tmp
;
}
}
...
...
@@ -165,7 +165,7 @@ __mthread_yield(mthread_virtual_processor_t *vp)
#endif
if
(
vp
->
resched
!=
NULL
)
{
fprintf
(
stderr
,
" *
SCHEDULER, Insert %p in ready list of %d
\n
"
,
(
void
*
)
vp
->
resched
,
vp
->
rank
);
LOG_INFO_SCT
(
"
SCHEDULER
"
,
"
Insert %p in ready list of %d"
,
(
void
*
)
vp
->
resched
,
vp
->
rank
);
mthread_insert_last
((
struct
mthread_s
*
)
vp
->
resched
,
&
(
vp
->
ready_list
));
vp
->
resched
=
NULL
;
}
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter