Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
36c9c968
Commit
36c9c968
authored
27 years ago
by
Bruce Momjian
Browse files
Options
Downloads
Patches
Plain Diff
Add static finding script.
parent
4a132abf
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/FIND_STATIC
+43
-0
43 additions, 0 deletions
src/FIND_STATIC
with
43 additions
and
0 deletions
src/FIND_STATIC
0 → 100644
+
43
−
0
View file @
36c9c968
#!/bin/sh
trap
"rm -f /tmp/
$$
"
0 1 2 3 15
# This script finds functions that are either never called, or
# should be static.
# Some functions, like library functions and debug_print functions,
# should remain unchanged.
# Run on a compiled source tree, from the top of the source tree
# My nm utility has 9 characters of address which I strip, then a 'type'
# character, with T as a text function, and U as an undefined function
# symbol, then the function name.
find
.
-name
'[a-z]*.o'
-type
f
-print
|
while
read
FILE
do
nm
$FILE
|
cut
-c10-100
|awk
'{printf "%s\t%s\t%s\n", "'
"
$FILE
"
'",$1,$2}'
done
>
/tmp/
$$
destroydb debug
createdb debug
echo
"
create table debug (file text, scope char, func text);
copy debug from '/tmp/"
$$
"';
select *
into table debug2
from debug;
update debug2
set scope = '_'
from debug
where debug2.func = debug.func and
debug2.scope = 'T' and debug.scope = 'U';
delete from debug2
where scope = '_';
select *
from debug2
where scope = 'T';
"
|psql debug
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