@@ -1231,6 +1231,18 @@ makeDatabase(Prof::CallPath::Profile& prof, const Analysis::Args& args)
1231
1231
Analysis::CallPath::write (prof, *os, args);
1232
1232
IOUtil::CloseStream (os);
1233
1233
1234
+ // 5. Create 'experiment.dtd' file
1235
+ string dtd_fnm = db_dir + " /" + Analysis_OUT_DB_DTD;
1236
+ os = IOUtil::OpenOStream (dtd_fnm.c_str ());
1237
+ os_buf = os->rdbuf ();
1238
+ os_buf->pubsetbuf (outBuf, HPCIO_RWBufferSz);
1239
+
1240
+ static const char * experimentDTD =
1241
+ #include < lib/xml/hpc-experiment.dtd.h>
1242
+ *os << experimentDTD;
1243
+
1244
+ IOUtil::CloseStream (os);
1245
+
1234
1246
delete[] outBuf;
1235
1247
}
1236
1248
@@ -1239,9 +1251,6 @@ static void
1239
1251
write (Prof::CallPath::Profile& prof, std::ostream& os,
1240
1252
const Analysis::Args& args)
1241
1253
{
1242
- static const char * experimentDTD =
1243
- #include < lib/xml/hpc-experiment.dtd.h>
1244
-
1245
1254
using namespace Prof ;
1246
1255
1247
1256
int oFlags = 0 ; // CCT::Tree::OFlg_LeafMetricsOnly;
@@ -1269,9 +1278,9 @@ write(Prof::CallPath::Profile& prof, std::ostream& os,
1269
1278
string name = (args.title .empty ()) ? prof.name () : args.title ;
1270
1279
1271
1280
os << " <?xml version=\" 1.0\" ?>\n " ;
1272
- os << " <!DOCTYPE HPCToolkitExperiment [\n " << experimentDTD << " ]>\n " ;
1273
1281
1274
1282
os << " <HPCToolkitExperiment version=\" " DATABASE_VERSION " \" >\n " ;
1283
+ os << " <!--DTD file=\" " Analysis_OUT_DB_DTD " \" -->\n " ;
1275
1284
os << " <Header n" << MakeAttrStr (name) << " >\n " ;
1276
1285
os << " <Info/>\n " ;
1277
1286
os << " </Header>\n " ;
0 commit comments