printLog macro

This commit is contained in:
Adrien Bourmault 2021-06-11 15:11:06 +02:00
parent 9f3d21ac20
commit f4711dab25
No known key found for this signature in database
GPG Key ID: 6EB408FE0ACEC664
3 changed files with 13 additions and 1 deletions

View File

@ -24,6 +24,7 @@
#include <unistd.h>
#include <stdio.h>
#include <malloc.h>
#include <string.h>
#define BASE_H
@ -37,6 +38,9 @@ struct {
int *space;
} typedef IntArray_t;
#define LOGMSG "[%s]"
#define printLog(FORMAT, ...) printf(LOGMSG " " FORMAT, __func__, ##__VA_ARGS__)
//
// Scheduler
//

View File

@ -53,6 +53,8 @@ void SchedulerCrashTest(void)
int main(int argc, char **argv)
{
printLog("Starting gem-graph-server...\n");
//
// Creating parameters structure for the Scheduler
//

View File

@ -22,6 +22,8 @@
#include "../include/base.h"
#include "../include/localworker.h"
#include <sys/sysinfo.h>
static void *GreatScheduler(void *parameters);
/* -------------------------------------------------------------------------- */
@ -41,9 +43,13 @@ pthread_t *SchedInit(SchedulerParams_t *parameters)
// -------------------------------------------------------------------------- //
static void *GreatScheduler(void *params)
{
// récupération des paramètres et annonce
SchedulerParams_t *parameters = (SchedulerParams_t*) params;
printLog("Scheduler id %lu: I'm alive!\n", *(parameters->id));
int ncpu = get_nprocs();
printLog("%d CPUs available.\n", ncpu);
printf("Scheduler id %p: I'm alive!\n", parameters->id);
return NULL;
}