Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
please codacy: use long form of negation in C++
[simgrid.git] / src / mc / mc_request.cpp
1 /* Copyright (c) 2008-2015. The SimGrid Team.
2  * All rights reserved.                                                     */
3
4 /* This program is free software; you can redistribute it and/or modify it
5  * under the terms of the license (GNU LGPL) which comes with this package. */
6
7 #include <cassert>
8
9 #include <xbt/log.h>
10 #include <xbt/str.h>
11 #include <xbt/sysdep.h>
12 #include <xbt/dynar.h>
13 #include <xbt/swag.h>
14
15 #include "src/mc/mc_request.h"
16 #include "src/mc/mc_safety.h"
17 #include "src/mc/mc_private.h"
18 #include "src/mc/mc_smx.h"
19 #include "src/mc/mc_xbt.hpp"
20
21 using simgrid::mc::remote;
22
23 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_request, mc,
24                                 "Logging specific to MC (request)");
25
26 static char *pointer_to_string(void *pointer);
27 static char *buff_size_to_string(size_t size);
28
29 static inline
30 simgrid::kernel::activity::Comm* MC_get_comm(smx_simcall_t r)
31 {
32   switch (r->call ) {
33   case SIMCALL_COMM_WAIT:
34     return static_cast<simgrid::kernel::activity::Comm*>(simcall_comm_wait__get__comm(r));
35   case SIMCALL_COMM_TEST:
36     return static_cast<simgrid::kernel::activity::Comm*>(simcall_comm_test__get__comm(r));
37   default:
38     return nullptr;
39   }
40 }
41
42 static inline
43 smx_mailbox_t MC_get_mbox(smx_simcall_t r)
44 {
45   switch(r->call) {
46   case SIMCALL_COMM_ISEND:
47     return simcall_comm_isend__get__mbox(r);
48   case SIMCALL_COMM_IRECV:
49     return simcall_comm_irecv__get__mbox(r);
50   default:
51     return nullptr;
52   }
53 }
54
55 namespace simgrid {
56 namespace mc {
57
58 // Does half the job
59 static inline
60 bool request_depend_asymmetric(smx_simcall_t r1, smx_simcall_t r2)
61 {
62   if (r1->call == SIMCALL_COMM_ISEND && r2->call == SIMCALL_COMM_IRECV)
63     return false;
64
65   if (r1->call == SIMCALL_COMM_IRECV && r2->call == SIMCALL_COMM_ISEND)
66     return false;
67
68   // Those are internal requests, we do not need indirection
69   // because those objects are copies:
70   simgrid::kernel::activity::Comm* synchro1 = MC_get_comm(r1);
71   simgrid::kernel::activity::Comm* synchro2 = MC_get_comm(r2);
72
73   if ((r1->call == SIMCALL_COMM_ISEND || r1->call == SIMCALL_COMM_IRECV)
74       && r2->call == SIMCALL_COMM_WAIT) {
75
76     smx_mailbox_t mbox = MC_get_mbox(r1);
77
78     if (mbox != synchro2->mbox_cpy
79         && simcall_comm_wait__get__timeout(r2) <= 0)
80       return false;
81
82     if ((r1->issuer != synchro2->src_proc)
83         && (r1->issuer != synchro2->dst_proc)
84         && simcall_comm_wait__get__timeout(r2) <= 0)
85       return false;
86
87     if ((r1->call == SIMCALL_COMM_ISEND)
88         && (synchro2->type == SIMIX_COMM_SEND)
89         && (synchro2->src_buff !=
90             simcall_comm_isend__get__src_buff(r1))
91         && simcall_comm_wait__get__timeout(r2) <= 0)
92       return false;
93
94     if ((r1->call == SIMCALL_COMM_IRECV)
95         && (synchro2->type == SIMIX_COMM_RECEIVE)
96         && (synchro2->dst_buff != simcall_comm_irecv__get__dst_buff(r1))
97         && simcall_comm_wait__get__timeout(r2) <= 0)
98       return false;
99   }
100
101   /* FIXME: the following rule assumes that the result of the
102    * isend/irecv call is not stored in a buffer used in the
103    * test call. */
104 #if 0
105   if((r1->call == SIMCALL_COMM_ISEND || r1->call == SIMCALL_COMM_IRECV)
106      &&  r2->call == SIMCALL_COMM_TEST)
107      return FALSE;
108 #endif
109
110   if (r1->call == SIMCALL_COMM_WAIT
111       && (r2->call == SIMCALL_COMM_WAIT || r2->call == SIMCALL_COMM_TEST)
112       && (synchro1->src_proc == nullptr || synchro1->dst_proc == nullptr))
113     return false;
114
115   if (r1->call == SIMCALL_COMM_TEST &&
116       (simcall_comm_test__get__comm(r1) == nullptr
117        || synchro1->src_buff == nullptr
118        || synchro1->dst_buff == nullptr))
119     return false;
120
121   if (r1->call == SIMCALL_COMM_TEST && r2->call == SIMCALL_COMM_WAIT
122       && synchro1->src_buff == synchro2->src_buff
123       && synchro1->dst_buff == synchro2->dst_buff)
124     return false;
125
126   if (r1->call == SIMCALL_COMM_WAIT && r2->call == SIMCALL_COMM_TEST
127       && synchro1->src_buff != nullptr
128       && synchro1->dst_buff != nullptr
129       && synchro2->src_buff != nullptr
130       && synchro2->dst_buff != nullptr
131       && synchro1->dst_buff != synchro2->src_buff
132       && synchro1->dst_buff != synchro2->dst_buff
133       && synchro2->dst_buff != synchro1->src_buff)
134     return false;
135
136   return true;
137 }
138
139 // Those are internal_req
140 bool request_depend(smx_simcall_t r1, smx_simcall_t r2)
141 {
142   if (r1->issuer == r2->issuer)
143     return false;
144
145   /* Wait with timeout transitions are not considered by the independence theorem, thus we consider them as dependent with all other transitions */
146   if ((r1->call == SIMCALL_COMM_WAIT && simcall_comm_wait__get__timeout(r1) > 0)
147       || (r2->call == SIMCALL_COMM_WAIT
148           && simcall_comm_wait__get__timeout(r2) > 0))
149     return TRUE;
150
151   if (r1->call != r2->call)
152     return request_depend_asymmetric(r1, r2)
153       && request_depend_asymmetric(r2, r1);
154
155   // Those are internal requests, we do not need indirection
156   // because those objects are copies:
157   simgrid::kernel::activity::Comm* synchro1 = MC_get_comm(r1);
158   simgrid::kernel::activity::Comm* synchro2 = MC_get_comm(r2);
159
160   switch(r1->call) {
161   case SIMCALL_COMM_ISEND:
162     return simcall_comm_isend__get__mbox(r1)
163       == simcall_comm_isend__get__mbox(r2);
164   case SIMCALL_COMM_IRECV:
165     return simcall_comm_irecv__get__mbox(r1)
166       == simcall_comm_irecv__get__mbox(r2);
167   case SIMCALL_COMM_WAIT:
168     if (synchro1->src_buff == synchro2->src_buff
169         && synchro1->dst_buff == synchro2->dst_buff)
170       return false;
171     else if (synchro1->src_buff != nullptr
172         && synchro1->dst_buff != nullptr
173         && synchro2->src_buff != nullptr
174         && synchro2->dst_buff != nullptr
175         && synchro1->dst_buff != synchro2->src_buff
176         && synchro1->dst_buff != synchro2->dst_buff
177         && synchro2->dst_buff != synchro1->src_buff)
178       return false;
179     else
180       return true;
181   default:
182     return true;
183   }
184 }
185
186 }
187 }
188
189 static char *pointer_to_string(void *pointer)
190 {
191
192   if (XBT_LOG_ISENABLED(mc_request, xbt_log_priority_verbose))
193     return bprintf("%p", pointer);
194
195   return xbt_strdup("(verbose only)");
196 }
197
198 static char *buff_size_to_string(size_t buff_size)
199 {
200
201   if (XBT_LOG_ISENABLED(mc_request, xbt_log_priority_verbose))
202     return bprintf("%zu", buff_size);
203
204   return xbt_strdup("(verbose only)");
205 }
206
207
208 std::string simgrid::mc::request_to_string(smx_simcall_t req, int value, simgrid::mc::RequestType request_type)
209 {
210   xbt_assert(mc_model_checker != nullptr);
211
212   bool use_remote_comm = true;
213   switch(request_type) {
214   case simgrid::mc::RequestType::simix:
215     use_remote_comm = true;
216     break;
217   case simgrid::mc::RequestType::executed:
218   case simgrid::mc::RequestType::internal:
219     use_remote_comm = false;
220     break;
221   }
222
223   const char* type = nullptr;
224   char *args = nullptr;
225
226   smx_actor_t issuer = MC_smx_simcall_get_issuer(req);
227
228   switch (req->call) {
229
230   case SIMCALL_COMM_ISEND: {
231     type = "iSend";
232     char* p = pointer_to_string(simcall_comm_isend__get__src_buff(req));
233     char* bs = buff_size_to_string(simcall_comm_isend__get__src_buff_size(req));
234     if (issuer->host)
235       args = bprintf("src=(%lu)%s (%s), buff=%s, size=%s", issuer->pid, MC_smx_actor_get_host_name(issuer),
236                      MC_smx_actor_get_name(issuer), p, bs);
237     else
238       args = bprintf("src=(%lu)%s, buff=%s, size=%s", issuer->pid, MC_smx_actor_get_name(issuer), p, bs);
239     xbt_free(bs);
240     xbt_free(p);
241     break;
242   }
243
244   case SIMCALL_COMM_IRECV: {
245     size_t* remote_size = simcall_comm_irecv__get__dst_buff_size(req);
246
247     // size_t size = size_pointer ? *size_pointer : 0;
248     size_t size = 0;
249     if (remote_size)
250       mc_model_checker->process().read_bytes(&size, sizeof(size),
251         remote(remote_size));
252
253     type = "iRecv";
254     char* p = pointer_to_string(simcall_comm_irecv__get__dst_buff(req));
255     char* bs = buff_size_to_string(size);
256     if (issuer->host)
257       args = bprintf("dst=(%lu)%s (%s), buff=%s, size=%s", issuer->pid, MC_smx_actor_get_host_name(issuer),
258                      MC_smx_actor_get_name(issuer), p, bs);
259     else
260       args = bprintf("dst=(%lu)%s, buff=%s, size=%s", issuer->pid, MC_smx_actor_get_name(issuer), p, bs);
261     xbt_free(bs);
262     xbt_free(p);
263     break;
264   }
265
266   case SIMCALL_COMM_WAIT: {
267     simgrid::kernel::activity::Comm* remote_act =
268       static_cast<simgrid::kernel::activity::Comm*>(simcall_comm_wait__get__comm(req));
269     char* p;
270     if (value == -1) {
271       type = "WaitTimeout";
272       p = pointer_to_string(remote_act);
273       args = bprintf("comm=%s", p);
274     } else {
275       type = "Wait";
276       p = pointer_to_string(remote_act);
277
278       simgrid::mc::Remote<simgrid::kernel::activity::Comm> temp_synchro;
279       simgrid::kernel::activity::Comm* act;
280       if (use_remote_comm) {
281         mc_model_checker->process().read(temp_synchro, remote(
282           static_cast<simgrid::kernel::activity::Comm*>(remote_act)));
283         act = temp_synchro.getBuffer();
284       } else
285         act = remote_act;
286
287       smx_actor_t src_proc = mc_model_checker->process().resolveActor(simgrid::mc::remote(act->src_proc));
288       smx_actor_t dst_proc = mc_model_checker->process().resolveActor(simgrid::mc::remote(act->dst_proc));
289       args =
290           bprintf("comm=%s [(%lu)%s (%s)-> (%lu)%s (%s)]", p, src_proc ? src_proc->pid : 0,
291                   src_proc ? MC_smx_actor_get_host_name(src_proc) : "", src_proc ? MC_smx_actor_get_name(src_proc) : "",
292                   dst_proc ? dst_proc->pid : 0, dst_proc ? MC_smx_actor_get_host_name(dst_proc) : "",
293                   dst_proc ? MC_smx_actor_get_name(dst_proc) : "");
294     }
295     xbt_free(p);
296     break;
297   }
298
299   case SIMCALL_COMM_TEST: {
300     simgrid::kernel::activity::Comm* remote_act = static_cast<simgrid::kernel::activity::Comm*>(
301       simcall_comm_test__get__comm(req));
302     simgrid::mc::Remote<simgrid::kernel::activity::Comm> temp_synchro;
303     simgrid::kernel::activity::Comm* act;
304     if (use_remote_comm) {
305       mc_model_checker->process().read(temp_synchro, remote(
306         static_cast<simgrid::kernel::activity::Comm*>(remote_act)));
307       act = temp_synchro.getBuffer();
308     } else
309       act = remote_act;
310
311     char* p;
312     if (act->src_proc == nullptr || act->dst_proc == nullptr) {
313       type = "Test FALSE";
314       p = pointer_to_string(remote_act);
315       args = bprintf("comm=%s", p);
316     } else {
317       type = "Test TRUE";
318       p = pointer_to_string(remote_act);
319
320       smx_actor_t src_proc = mc_model_checker->process().resolveActor(simgrid::mc::remote(act->src_proc));
321       smx_actor_t dst_proc = mc_model_checker->process().resolveActor(simgrid::mc::remote(act->dst_proc));
322       args = bprintf("comm=%s [(%lu)%s (%s) -> (%lu)%s (%s)]", p, src_proc->pid, MC_smx_actor_get_name(src_proc),
323                      MC_smx_actor_get_host_name(src_proc), dst_proc->pid, MC_smx_actor_get_name(dst_proc),
324                      MC_smx_actor_get_host_name(dst_proc));
325     }
326     xbt_free(p);
327     break;
328   }
329
330   case SIMCALL_COMM_WAITANY: {
331     type = "WaitAny";
332     s_xbt_dynar_t comms;
333     mc_model_checker->process().read_bytes(
334       &comms, sizeof(comms), remote(simcall_comm_waitany__get__comms(req)));
335     if (not xbt_dynar_is_empty(&comms)) {
336       smx_activity_t remote_sync;
337       read_element(mc_model_checker->process(),
338         &remote_sync, remote(simcall_comm_waitany__get__comms(req)), value,
339         sizeof(remote_sync));
340       char* p = pointer_to_string(remote_sync);
341       args = bprintf("comm=%s (%d of %lu)",
342         p, value + 1, xbt_dynar_length(&comms));
343       xbt_free(p);
344     } else
345       args = bprintf("comm at idx %d", value);
346     break;
347   }
348
349   case SIMCALL_COMM_TESTANY:
350     if (value == -1) {
351       type = "TestAny FALSE";
352       args = xbt_strdup("-");
353     } else {
354       type = "TestAny";
355       args =
356           bprintf("(%d of %zu)", value + 1,
357                     simcall_comm_testany__get__count(req));
358     }
359     break;
360
361   case SIMCALL_MUTEX_TRYLOCK:
362   case SIMCALL_MUTEX_LOCK: {
363     if (req->call == SIMCALL_MUTEX_LOCK)
364       type = "Mutex LOCK";
365     else
366       type = "Mutex TRYLOCK";
367
368     simgrid::mc::Remote<simgrid::simix::Mutex> mutex;
369     mc_model_checker->process().read_bytes(mutex.getBuffer(), sizeof(mutex),
370       remote(
371         req->call == SIMCALL_MUTEX_LOCK
372         ? simcall_mutex_lock__get__mutex(req)
373         : simcall_mutex_trylock__get__mutex(req)
374       ));
375     s_xbt_swag_t mutex_sleeping;
376     mc_model_checker->process().read_bytes(&mutex_sleeping, sizeof(mutex_sleeping),
377       remote(mutex.getBuffer()->sleeping));
378
379     args =
380         bprintf("locked = %d, owner = %d, sleeping = %d", mutex.getBuffer()->locked,
381                 mutex.getBuffer()->owner != nullptr
382                     ? (int)mc_model_checker->process().resolveActor(simgrid::mc::remote(mutex.getBuffer()->owner))->pid
383                     : -1,
384                 mutex_sleeping.count);
385     break;
386   }
387
388   case SIMCALL_MC_RANDOM:
389     type = "MC_RANDOM";
390     args = bprintf("%d", value);
391     break;
392
393   default:
394     type = SIMIX_simcall_name(req->call);
395     args = bprintf("??");
396     break;
397   }
398
399   std::string str;
400   if (args != nullptr)
401     str = simgrid::xbt::string_printf("[(%lu)%s (%s)] %s(%s)", issuer->pid, MC_smx_actor_get_host_name(issuer),
402                                       MC_smx_actor_get_name(issuer), type, args);
403   else
404     str = simgrid::xbt::string_printf("[(%lu)%s (%s)] %s ", issuer->pid, MC_smx_actor_get_host_name(issuer),
405                                       MC_smx_actor_get_name(issuer), type);
406   xbt_free(args);
407   return str;
408 }
409
410 namespace simgrid {
411 namespace mc {
412
413 bool request_is_enabled_by_idx(smx_simcall_t req, unsigned int idx)
414 {
415   smx_activity_t remote_act = nullptr;
416   switch (req->call) {
417
418   case SIMCALL_COMM_WAIT:
419     /* FIXME: check also that src and dst processes are not suspended */
420     remote_act = simcall_comm_wait__get__comm(req);
421     break;
422
423   case SIMCALL_COMM_WAITANY: {
424     read_element(
425       mc_model_checker->process(), &remote_act,
426       remote(simcall_comm_waitany__get__comms(req)),
427       idx, sizeof(remote_act));
428     }
429     break;
430
431   case SIMCALL_COMM_TESTANY:
432     remote_act = mc_model_checker->process().read(remote(
433       simcall_comm_testany__get__comms(req) + idx));
434     break;
435
436   default:
437     return true;
438   }
439
440   simgrid::mc::Remote<simgrid::kernel::activity::Comm> temp_comm;
441   mc_model_checker->process().read(temp_comm, remote(
442     static_cast<simgrid::kernel::activity::Comm*>(remote_act)));
443   simgrid::kernel::activity::Comm* comm = temp_comm.getBuffer();
444   return comm->src_proc && comm->dst_proc;
445 }
446
447 bool actor_is_enabled(smx_actor_t actor)
448 {
449   return simgrid::mc::request_is_enabled(&actor->simcall);
450 }
451
452 static const char* colors[] = {
453   "blue",
454   "red",
455   "green3",
456   "goldenrod",
457   "brown",
458   "purple",
459   "magenta",
460   "turquoise4",
461   "gray25",
462   "forestgreen",
463   "hotpink",
464   "lightblue",
465   "tan",
466 };
467
468 static inline const char* get_color(int id)
469 {
470   return colors[id % (sizeof(colors) / sizeof(colors[0])) ];
471 }
472
473 std::string request_get_dot_output(smx_simcall_t req, int value)
474 {
475   std::string label;
476
477   const smx_actor_t issuer = MC_smx_simcall_get_issuer(req);
478
479   switch (req->call) {
480   case SIMCALL_COMM_ISEND:
481     if (issuer->host)
482       label = simgrid::xbt::string_printf("[(%lu)%s] iSend", issuer->pid, MC_smx_actor_get_host_name(issuer));
483     else
484       label = bprintf("[(%lu)] iSend", issuer->pid);
485     break;
486
487   case SIMCALL_COMM_IRECV:
488     if (issuer->host)
489       label = simgrid::xbt::string_printf("[(%lu)%s] iRecv", issuer->pid, MC_smx_actor_get_host_name(issuer));
490     else
491       label = simgrid::xbt::string_printf("[(%lu)] iRecv", issuer->pid);
492     break;
493
494   case SIMCALL_COMM_WAIT: {
495     if (value == -1) {
496       if (issuer->host)
497         label = simgrid::xbt::string_printf("[(%lu)%s] WaitTimeout", issuer->pid, MC_smx_actor_get_host_name(issuer));
498       else
499         label = simgrid::xbt::string_printf("[(%lu)] WaitTimeout", issuer->pid);
500     } else {
501       smx_activity_t remote_act = simcall_comm_wait__get__comm(req);
502       simgrid::mc::Remote<simgrid::kernel::activity::Comm> temp_comm;
503       mc_model_checker->process().read(temp_comm, remote(
504         static_cast<simgrid::kernel::activity::Comm*>(remote_act)));
505       simgrid::kernel::activity::Comm* comm = temp_comm.getBuffer();
506
507       smx_actor_t src_proc = mc_model_checker->process().resolveActor(simgrid::mc::remote(comm->src_proc));
508       smx_actor_t dst_proc = mc_model_checker->process().resolveActor(simgrid::mc::remote(comm->dst_proc));
509       if (issuer->host)
510         label = simgrid::xbt::string_printf("[(%lu)%s] Wait [(%lu)->(%lu)]", issuer->pid,
511                                             MC_smx_actor_get_host_name(issuer), src_proc ? src_proc->pid : 0,
512                                             dst_proc ? dst_proc->pid : 0);
513       else
514         label = simgrid::xbt::string_printf("[(%lu)] Wait [(%lu)->(%lu)]",
515                     issuer->pid,
516                     src_proc ? src_proc->pid : 0,
517                     dst_proc ? dst_proc->pid : 0);
518     }
519     break;
520   }
521
522   case SIMCALL_COMM_TEST: {
523     smx_activity_t remote_act = simcall_comm_test__get__comm(req);
524     simgrid::mc::Remote<simgrid::kernel::activity::Comm> temp_comm;
525     mc_model_checker->process().read(temp_comm, remote(
526       static_cast<simgrid::kernel::activity::Comm*>(remote_act)));
527     simgrid::kernel::activity::Comm* comm = temp_comm.getBuffer();
528     if (comm->src_proc == nullptr || comm->dst_proc == nullptr) {
529       if (issuer->host)
530         label = simgrid::xbt::string_printf("[(%lu)%s] Test FALSE", issuer->pid, MC_smx_actor_get_host_name(issuer));
531       else
532         label = bprintf("[(%lu)] Test FALSE", issuer->pid);
533     } else {
534       if (issuer->host)
535         label = simgrid::xbt::string_printf("[(%lu)%s] Test TRUE", issuer->pid, MC_smx_actor_get_host_name(issuer));
536       else
537         label = simgrid::xbt::string_printf("[(%lu)] Test TRUE", issuer->pid);
538     }
539     break;
540   }
541
542   case SIMCALL_COMM_WAITANY: {
543     unsigned long comms_size = read_length(
544       mc_model_checker->process(), remote(simcall_comm_waitany__get__comms(req)));
545     if (issuer->host)
546       label = simgrid::xbt::string_printf("[(%lu)%s] WaitAny [%d of %lu]", issuer->pid,
547                                           MC_smx_actor_get_host_name(issuer), value + 1, comms_size);
548     else
549       label = simgrid::xbt::string_printf("[(%lu)] WaitAny [%d of %lu]",
550                   issuer->pid, value + 1, comms_size);
551     break;
552   }
553
554   case SIMCALL_COMM_TESTANY:
555     if (value == -1) {
556       if (issuer->host)
557         label = simgrid::xbt::string_printf("[(%lu)%s] TestAny FALSE", issuer->pid, MC_smx_actor_get_host_name(issuer));
558       else
559         label = simgrid::xbt::string_printf("[(%lu)] TestAny FALSE", issuer->pid);
560     } else {
561       if (issuer->host)
562         label = simgrid::xbt::string_printf("[(%lu)%s] TestAny TRUE [%d of %lu]", issuer->pid,
563                                             MC_smx_actor_get_host_name(issuer), value + 1,
564                                             simcall_comm_testany__get__count(req));
565       else
566         label = simgrid::xbt::string_printf("[(%lu)] TestAny TRUE [%d of %lu]",
567                     issuer->pid,
568                     value + 1,
569                     simcall_comm_testany__get__count(req));
570     }
571     break;
572
573   case SIMCALL_MUTEX_TRYLOCK:
574     label = simgrid::xbt::string_printf("[(%lu)] Mutex TRYLOCK", issuer->pid);
575     break;
576
577   case SIMCALL_MUTEX_LOCK:
578     label = simgrid::xbt::string_printf("[(%lu)] Mutex LOCK", issuer->pid);
579     break;
580
581   case SIMCALL_MC_RANDOM:
582     if (issuer->host)
583       label = simgrid::xbt::string_printf("[(%lu)%s] MC_RANDOM (%d)", issuer->pid, MC_smx_actor_get_host_name(issuer),
584                                           value);
585     else
586       label = simgrid::xbt::string_printf("[(%lu)] MC_RANDOM (%d)", issuer->pid, value);
587     break;
588
589   default:
590     THROW_UNIMPLEMENTED;
591   }
592
593   const char* color = get_color(issuer->pid - 1);
594   return  simgrid::xbt::string_printf(
595         "label = \"%s\", color = %s, fontcolor = %s", label.c_str(),
596         color, color);
597 }
598
599 }
600 }