Merge branch 'master' into blender2.8
authorSergey Sharybin <sergey.vfx@gmail.com>
Thu, 21 Dec 2017 16:17:27 +0000 (17:17 +0100)
committerSergey Sharybin <sergey.vfx@gmail.com>
Thu, 21 Dec 2017 16:17:27 +0000 (17:17 +0100)
1  2 
source/blender/depsgraph/intern/debug/deg_debug_stats_gnuplot.cc

index 3e20196c2ea1f90bce5de3d287da4e66aea6637a,e92c77304827fc2740da918f1ad989a144efe453..b889ebf8a8fb1b13c2108951a711a68d07b724cf
@@@ -78,9 -97,21 +97,21 @@@ void write_stats_data(const DebugContex
                if (time == 0.0) {
                        continue;
                }
+               StatsEntry entry;
+               entry.id_node = id_node;
+               entry.time = time;
+               stats.push_back(entry);
+       }
+       // Sort the data.
+       std::sort(stats.begin(), stats.end(), stat_entry_comparator);
+       // We limit number of entries, otherwise things become unreadable.
+       stats.resize(min_ii(stats.size(), 32));
+       // Print data to the file stream.
+       deg_debug_fprintf(ctx, "$data << EOD" NL);
+       foreach (const StatsEntry& entry, stats) {
                deg_debug_fprintf(ctx, "\"%s\",%f" NL,
 -                                entry.id_node->id->name + 2,
 +                                id_node->id_orig->name + 2,
-                                 time);
+                                 entry.time);
        }
        deg_debug_fprintf(ctx, "EOD" NL);
  }