Logo AND Algorithmique Numérique Distribuée

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