Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cppack
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
passwords
cppack
Commits
992dcda5
Commit
992dcda5
authored
Feb 4, 2020
by
Mathieu Valois
Browse files
Options
Downloads
Patches
Plain Diff
Fix GUI according to rebase
parent
2e46593c
No related branches found
No related tags found
No related merge requests found
Pipeline
#6302
passed
Feb 4, 2020
Stage: test
Changes
4
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
include/MainWindow.h
+3
-4
3 additions, 4 deletions
include/MainWindow.h
include/Statsgen.h
+8
-1
8 additions, 1 deletion
include/Statsgen.h
include/ThreadData.h
+0
-2
0 additions, 2 deletions
include/ThreadData.h
src/core/Statsgen.cpp
+7
-3
7 additions, 3 deletions
src/core/Statsgen.cpp
with
18 additions
and
10 deletions
include/MainWindow.h
+
3
−
4
View file @
992dcda5
...
...
@@ -30,19 +30,18 @@ class ProgressThread : public QThread
uint64_t
processed
=
0
;
int
finished
=
0
;
const
int
nbthreads
=
_s
.
getNbThreads
();
const
struct
t
hread
_d
ata
*
td
=
_s
.
getThreadsData
();
const
struct
T
hread
D
ata
*
td
=
_s
.
getThreadsData
();
while
(
td
[
nbthreads
-
1
].
lineEnd
==
0
){
while
(
!
_s
.
allStarted
()
){
msleep
(
500
);
}
const
uint64_t
nblines
=
td
[
nbthreads
-
1
].
lineEnd
;
while
(
finished
!=
nbthreads
){
while
(
!
_s
.
allFinished
()
){
processed
=
0
;
finished
=
0
;
for
(
int
i
=
0
;
i
<
nbthreads
;
++
i
){
processed
+=
td
[
i
].
total_counter
;
finished
+=
td
[
i
].
finished
;
}
progress
=
(
int
)
percentage
(
processed
,
nblines
);
_qpb
.
setValue
(
progress
);
...
...
This diff is collapsed.
Click to expand it.
include/Statsgen.h
+
8
−
1
View file @
992dcda5
...
...
@@ -144,6 +144,8 @@ public:
inline
const
StringOccurrence
&
getStatsSimple
()
const
{
return
stats_simplemasks
;
}
inline
const
StringOccurrence
&
getStatsAdvanced
()
const
{
return
stats_advancedmasks
;
}
inline
const
ThreadData
*
getThreadsData
()
const
{
return
td
;
}
inline
bool
allFinished
()
const
{
return
finished
==
nbThread
;
}
inline
bool
allStarted
()
const
{
return
started
;
}
private
:
std
::
string
filename
;
...
...
@@ -158,7 +160,7 @@ private:
bool
withcount
=
false
;
// Know if the database is at the format withcount or not
int
limitSimplemask
=
12
;
// Limit the size of Simple Mask
int
limitAdvancedmask
=
12
;
// Limit the size of Advanced Mask
int
nbThread
=
1
;
// Number of usable threads, default 1
u
int
nbThread
=
1
;
// Number of usable threads, default 1
std
::
string
outfile_name
;
// File where to write masks
bool
is_stdin
=
false
;
// If filename is stdin
bool
debug_enabled
=
false
;
// Enable debug output
...
...
@@ -182,6 +184,11 @@ private:
// Security policy
SecurityRules
_sr
=
{
0
,
8
,
0
,
1
,
1
,
1
};
// threads which have finished
uint
finished
=
0
;
// all threads have been started
bool
started
=
false
;
};
...
...
This diff is collapsed.
Click to expand it.
include/ThreadData.h
+
0
−
2
View file @
992dcda5
...
...
@@ -54,8 +54,6 @@ struct ThreadData {
uint
limitAdvancedmask
;
SecurityRules
sr
;
bool
finished
=
false
;
};
#endif // THREAD_DATA_H
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/core/Statsgen.cpp
+
7
−
3
View file @
992dcda5
...
...
@@ -63,6 +63,8 @@ void Statsgen::configureThread(ThreadData& td) const {
}
int
Statsgen
::
generate_stats
()
{
finished
=
0
;
started
=
false
;
uint64_t
nbline
=
0
;
if
(
!
is_stdin
){
nbline
=
nbline_file
(
filename
);
...
...
@@ -84,7 +86,7 @@ int Statsgen::generate_stats() {
}
}
for
(
int
i
=
0
;
i
<
nbThread
;
i
++
)
{
for
(
u
int
i
=
0
;
i
<
nbThread
;
i
++
)
{
td
[
i
].
thread_id
=
i
+
1
;
configureThread
(
td
[
i
]);
...
...
@@ -116,14 +118,16 @@ int Statsgen::generate_stats() {
}
}
started
=
true
;
void
*
status
;
for
(
int
i
=
0
;
i
<
nbThread
;
i
++
)
{
for
(
u
int
i
=
0
;
i
<
nbThread
;
i
++
)
{
int
rc
=
pthread_join
(
threads
[
i
],
&
status
);
if
(
rc
)
{
cerr
<<
"[ERROR] unable to join,"
<<
rc
<<
endl
;
exit
(
-
1
);
}
td
[
i
].
finished
=
true
;
finished
++
;
if
(
i
>=
1
){
td
[
0
]
+=
td
[
i
];
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment