Compare commits
10 Commits
c0ac6cc3c5
...
dev
Author | SHA1 | Date | |
---|---|---|---|
f88c1d4bdf | |||
4193fd40c1 | |||
504dc476b1 | |||
8ff872cf36 | |||
9c4dbd51c8 | |||
2829143bbe | |||
5185097075 | |||
573cd59892 | |||
8b1f667819 | |||
c2ca2ff573 |
5
.github/workflows/cmake.yml
vendored
5
.github/workflows/cmake.yml
vendored
@@ -19,7 +19,10 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- name: Checkout Repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
- name: Install system dependencies
|
- name: Install system dependencies
|
||||||
if: runner.os == 'Linux'
|
if: runner.os == 'Linux'
|
||||||
|
2
3rdparty/libfort
vendored
2
3rdparty/libfort
vendored
Submodule 3rdparty/libfort updated: 41237162a9...5a8f9312bd
@@ -24,7 +24,7 @@ if(NOT WIN32)
|
|||||||
set(BoldWhite "${Esc}[1;37m")
|
set(BoldWhite "${Esc}[1;37m")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 2.8)
|
cmake_minimum_required(VERSION 2.8...3.18)
|
||||||
find_package(PkgConfig REQUIRED)
|
find_package(PkgConfig REQUIRED)
|
||||||
pkg_search_module(GLIB REQUIRED glib-2.0)
|
pkg_search_module(GLIB REQUIRED glib-2.0)
|
||||||
pkg_check_modules(GTK3 REQUIRED gtk+-3.0)
|
pkg_check_modules(GTK3 REQUIRED gtk+-3.0)
|
||||||
|
123
command-line.c
123
command-line.c
@@ -61,18 +61,18 @@ struct analysis_format_cmdarg {
|
|||||||
|
|
||||||
|
|
||||||
static const struct analysis_format_cmdarg analysis_format_lookup[] = {
|
static const struct analysis_format_cmdarg analysis_format_lookup[] = {
|
||||||
{
|
{
|
||||||
.format = ANA_FORMAT_SIMPLE,
|
.format = ANA_FORMAT_SIMPLE,
|
||||||
.argument = "simple",
|
.argument = "simple",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
.format = ANA_FORMAT_PRETTY,
|
.format = ANA_FORMAT_PRETTY,
|
||||||
.argument = "pretty",
|
.argument = "pretty",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
.format = ANA_FORMAT_CELLS_ONLY,
|
.format = ANA_FORMAT_CELLS_ONLY,
|
||||||
.argument = "cellsonly"
|
.argument = "cellsonly"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
static int string_array_count(char **string_array)
|
static int string_array_count(char **string_array)
|
||||||
@@ -297,84 +297,92 @@ static int printf_indented(int level, const char *format, ...)
|
|||||||
|
|
||||||
static void print_simple_stat(GList *lib_stat_list)
|
static void print_simple_stat(GList *lib_stat_list)
|
||||||
{
|
{
|
||||||
#if 0
|
|
||||||
int indentation_level = 0;
|
int indentation_level = 0;
|
||||||
GList *lib_iter;
|
GList *lib_iter;
|
||||||
GList *cell_iter;
|
GList *cell_iter;
|
||||||
const struct gds_lib_statistics *lib_stats;
|
const struct gds_library *lib;
|
||||||
const struct gds_cell_statistics *cell_stats;
|
const struct gds_cell *cell;
|
||||||
|
const struct gds_lib_statistics *lib_stat;
|
||||||
|
const struct gds_cell_statistics *cell_stat;
|
||||||
|
|
||||||
for (lib_iter = lib_stat_list; lib_iter; lib_iter = g_list_next(lib_iter)) {
|
for (lib_iter = lib_stat_list; lib_iter; lib_iter = g_list_next(lib_iter)) {
|
||||||
lib_stats = (const struct gds_lib_statistics *)lib_iter->data;
|
lib = (const struct gds_library *)lib_iter->data;
|
||||||
printf_indented(indentation_level, "Library %s\n", lib_stats->library->name);
|
lib_stat = &lib->stats;
|
||||||
|
printf_indented(indentation_level, "Library %s\n", lib->name);
|
||||||
indentation_level++;
|
indentation_level++;
|
||||||
|
|
||||||
for (cell_iter = lib_stats->cell_statistics; cell_iter; cell_iter = g_list_next(cell_iter)) {
|
for (cell_iter = lib->cells; cell_iter; cell_iter = g_list_next(cell_iter)) {
|
||||||
cell_stats = (const struct gds_cell_statistics *)cell_iter->data;
|
cell = (const struct gds_cell *)cell_iter->data;
|
||||||
printf_indented(indentation_level, "Cell %s\n", cell_stats->cell->name);
|
cell_stat = &cell->stats;
|
||||||
|
printf_indented(indentation_level, "Cell %s\n", cell->name);
|
||||||
indentation_level++;
|
indentation_level++;
|
||||||
printf_indented(indentation_level, "Reference count: %zu\n", cell_stats->reference_count);
|
printf_indented(indentation_level, "Reference count: %zu\n", cell_stat->reference_count);
|
||||||
printf_indented(indentation_level, "Graphics count: %zu\n", cell_stats->gfx_count);
|
printf_indented(indentation_level, "Graphics count: %zu\n", cell_stat->gfx_count);
|
||||||
printf_indented(indentation_level, "Vertex count: %zu\n", cell_stats->vertex_count);
|
printf_indented(indentation_level, "Total Graphics count: %zu\n", cell_stat->total_gfx_count);
|
||||||
|
printf_indented(indentation_level, "Vertex count: %zu\n", cell_stat->vertex_count);
|
||||||
|
printf_indented(indentation_level, "Total Vertex count: %zu\n", cell_stat->total_vertex_count);
|
||||||
printf_indented(indentation_level, "Unresolved children: %d\n",
|
printf_indented(indentation_level, "Unresolved children: %d\n",
|
||||||
cell_stats->cell->checks.unresolved_child_count);
|
cell->checks.unresolved_child_count);
|
||||||
printf_indented(indentation_level, "Reference loop: %s\n",
|
printf_indented(indentation_level, "Reference loop: %s\n",
|
||||||
cell_stats->cell->checks.affected_by_reference_loop ? "yes" : "no");
|
cell->checks.affected_by_reference_loop ? "yes" : "no");
|
||||||
|
|
||||||
indentation_level--;
|
indentation_level--;
|
||||||
}
|
}
|
||||||
printf_indented(indentation_level, "Cell count: %zu\n", lib_stats->cell_count);
|
printf_indented(indentation_level, "Cell count: %zu\n", lib_stat->cell_count);
|
||||||
printf_indented(indentation_level, "Reference count: %zu\n", lib_stats->reference_count);
|
printf_indented(indentation_level, "Reference count: %zu\n", lib_stat->reference_count);
|
||||||
printf_indented(indentation_level, "Graphics count: %zu\n", lib_stats->gfx_count);
|
printf_indented(indentation_level, "Graphics count: %zu\n", lib_stat->gfx_count);
|
||||||
printf_indented(indentation_level, "Vertex count: %zu\n", lib_stats->vertex_count);
|
printf_indented(indentation_level, "Vertex count: %zu\n", lib_stat->vertex_count);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void print_table_stat(GList *lib_stat_list)
|
static void table_stat_create_cell_row(struct gds_cell *cell, ft_table_t *tab)
|
||||||
{
|
{
|
||||||
#if 0
|
ft_printf_ln(tab, "%s|%s|%zu|%zu|%zu|%zu|%zu|%d|%s",
|
||||||
ft_table_t *table;
|
cell->parent_library->name,
|
||||||
GList *lib_stat_iter;
|
cell->name,
|
||||||
GList *cell_stat_iter;
|
cell->stats.gfx_count,
|
||||||
const struct gds_lib_statistics *lib_stats;
|
cell->stats.total_gfx_count,
|
||||||
const struct gds_cell_statistics *cell_stats;
|
cell->stats.vertex_count,
|
||||||
|
cell->stats.total_vertex_count,
|
||||||
|
cell->stats.reference_count,
|
||||||
|
cell->checks.unresolved_child_count,
|
||||||
|
cell->checks.affected_by_reference_loop ? "yes" : "no");
|
||||||
|
}
|
||||||
|
|
||||||
|
static void table_stat_table_for_lib(struct gds_library *lib, ft_table_t *tab)
|
||||||
|
{
|
||||||
|
ft_printf_ln(tab, "%s|%zu|%zu|-|%zu|-|%zu|-|-",
|
||||||
|
lib->name,
|
||||||
|
lib->stats.cell_count,
|
||||||
|
lib->stats.gfx_count,
|
||||||
|
lib->stats.vertex_count,
|
||||||
|
lib->stats.reference_count);
|
||||||
|
g_list_foreach(lib->cells, (GFunc)table_stat_create_cell_row, tab);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void print_table_stat(GList *lib_list)
|
||||||
|
{
|
||||||
|
ft_table_t *table;
|
||||||
table = ft_create_table();
|
table = ft_create_table();
|
||||||
|
|
||||||
ft_set_cell_prop(table, 0, FT_ANY_COLUMN, FT_CPROP_ROW_TYPE, FT_ROW_HEADER);
|
ft_set_cell_prop(table, 0, FT_ANY_COLUMN, FT_CPROP_ROW_TYPE, FT_ROW_HEADER);
|
||||||
|
ft_write_ln(table, "Library", "Cell", "GFX", "GFX+", "Vertices", "Vertices+", "Refs", "Unresolved Refs", "Loops");
|
||||||
|
|
||||||
ft_set_cell_prop(table, 0, FT_ANY_COLUMN, FT_CPROP_ROW_TYPE, FT_ROW_HEADER);
|
g_list_foreach(lib_list, (GFunc)table_stat_table_for_lib, table);
|
||||||
ft_write_ln(table, "Library", "Cell", "GFX", "Vertices", "Refs", "Unresolved Refs", "Loops");
|
|
||||||
for (lib_stat_iter = lib_stat_list; lib_stat_iter; lib_stat_iter = g_list_next(lib_stat_iter)) {
|
|
||||||
lib_stats = (const struct gds_lib_statistics *)lib_stat_iter->data;
|
|
||||||
ft_printf_ln(table, "%s|%zu|%zu|%zu|%zu|-|-", lib_stats->library->name, lib_stats->cell_count,
|
|
||||||
lib_stats->gfx_count, lib_stats->vertex_count, lib_stats->reference_count);
|
|
||||||
for (cell_stat_iter = lib_stats->cell_statistics; cell_stat_iter;
|
|
||||||
cell_stat_iter = g_list_next(cell_stat_iter)) {
|
|
||||||
cell_stats = (const struct gds_cell_statistics *)cell_stat_iter->data;
|
|
||||||
ft_printf_ln(table, "%s|%s|%zu|%zu|%zu|%d|%d", lib_stats->library->name, cell_stats->cell->name,
|
|
||||||
cell_stats->gfx_count, cell_stats->vertex_count, cell_stats->reference_count,
|
|
||||||
cell_stats->cell->checks.unresolved_child_count,
|
|
||||||
cell_stats->cell->checks.affected_by_reference_loop);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
printf("%s\n", ft_to_string(table));
|
printf("%s\n", ft_to_string(table));
|
||||||
ft_destroy_table(table);
|
ft_destroy_table(table);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void print_statistics(enum analysis_format format, GList *lib_stat_list)
|
static void print_statistics(enum analysis_format format, GList *lib_list)
|
||||||
{
|
{
|
||||||
switch (format) {
|
switch (format) {
|
||||||
case ANA_FORMAT_PRETTY:
|
case ANA_FORMAT_PRETTY:
|
||||||
print_table_stat(lib_stat_list);
|
print_table_stat(lib_list);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
print_simple_stat(lib_stat_list);
|
print_simple_stat(lib_list);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -448,6 +456,7 @@ int command_line_analyze_lib(const char *format, const char *gds_name)
|
|||||||
goto return_clear_libs;
|
goto return_clear_libs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print_statistics(fmt, lib_list);
|
||||||
|
|
||||||
return_clear_libs:
|
return_clear_libs:
|
||||||
clear_lib_list(&lib_list);
|
clear_lib_list(&lib_list);
|
||||||
|
@@ -284,8 +284,9 @@ static GList *append_library(GList *curr_list, const struct gds_library_parsing_
|
|||||||
lib->stats.gfx_count = 0;
|
lib->stats.gfx_count = 0;
|
||||||
lib->stats.reference_count = 0;
|
lib->stats.reference_count = 0;
|
||||||
lib->stats.vertex_count = 0;
|
lib->stats.vertex_count = 0;
|
||||||
} else
|
} else {
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
if (library_ptr)
|
if (library_ptr)
|
||||||
*library_ptr = lib;
|
*library_ptr = lib;
|
||||||
|
|
||||||
@@ -363,6 +364,7 @@ static GList *append_cell(GList *curr_list, struct gds_cell **cell_ptr)
|
|||||||
cell->checks.affected_by_reference_loop = GDS_CELL_CHECK_NOT_RUN;
|
cell->checks.affected_by_reference_loop = GDS_CELL_CHECK_NOT_RUN;
|
||||||
cell->stats.reference_count = 0;
|
cell->stats.reference_count = 0;
|
||||||
cell->stats.total_vertex_count = 0;
|
cell->stats.total_vertex_count = 0;
|
||||||
|
cell->stats.total_gfx_count = 0;
|
||||||
cell->stats.gfx_count = 0;
|
cell->stats.gfx_count = 0;
|
||||||
cell->stats.vertex_count = 0;
|
cell->stats.vertex_count = 0;
|
||||||
} else
|
} else
|
||||||
|
2
main.c
2
main.c
@@ -201,7 +201,7 @@ static int start_gui(int argc, char **argv)
|
|||||||
application_domain = g_string_new(NULL);
|
application_domain = g_string_new(NULL);
|
||||||
g_string_printf(application_domain, "de.shimatta.gds_render_%s", _app_git_commit);
|
g_string_printf(application_domain, "de.shimatta.gds_render_%s", _app_git_commit);
|
||||||
|
|
||||||
gapp = gtk_application_new(application_domain->str, G_APPLICATION_FLAGS_NONE);
|
gapp = gtk_application_new(application_domain->str, G_APPLICATION_DEFAULT_FLAGS);
|
||||||
g_string_free(application_domain, TRUE);
|
g_string_free(application_domain, TRUE);
|
||||||
|
|
||||||
g_application_register(G_APPLICATION(gapp), NULL, NULL);
|
g_application_register(G_APPLICATION(gapp), NULL, NULL);
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
project(pluginexample)
|
project(pluginexample)
|
||||||
cmake_minimum_required(VERSION 2.8)
|
cmake_minimum_required(VERSION 2.8...3.18)
|
||||||
find_package(PkgConfig REQUIRED)
|
find_package(PkgConfig REQUIRED)
|
||||||
pkg_search_module(PYTHON REQUIRED python3)
|
pkg_search_module(PYTHON REQUIRED python3)
|
||||||
|
|
||||||
|
@@ -22,7 +22,7 @@ if(NOT WIN32)
|
|||||||
set(BoldWhite "${Esc}[1;37m")
|
set(BoldWhite "${Esc}[1;37m")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 2.8)
|
cmake_minimum_required(VERSION 2.8...3.18)
|
||||||
find_package(PkgConfig REQUIRED)
|
find_package(PkgConfig REQUIRED)
|
||||||
|
|
||||||
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/catch-framework")
|
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/catch-framework")
|
||||||
|
Reference in New Issue
Block a user