Tom Zanussi | d1b9377 | 2009-11-25 01:15:50 -0600 | [diff] [blame] | 1 | /* |
| 2 | * This file was generated automatically by ExtUtils::ParseXS version 2.18_02 from the |
| 3 | * contents of Context.xs. Do not edit this file, edit Context.xs instead. |
| 4 | * |
| 5 | * ANY CHANGES MADE HERE WILL BE LOST! |
| 6 | * |
| 7 | */ |
| 8 | |
| 9 | #line 1 "Context.xs" |
| 10 | /* |
Arnaldo Carvalho de Melo | 765532c | 2010-12-23 13:10:22 -0200 | [diff] [blame] | 11 | * Context.xs. XS interfaces for perf script. |
Tom Zanussi | d1b9377 | 2009-11-25 01:15:50 -0600 | [diff] [blame] | 12 | * |
| 13 | * Copyright (C) 2009 Tom Zanussi <tzanussi@gmail.com> |
| 14 | * |
| 15 | * This program is free software; you can redistribute it and/or modify |
| 16 | * it under the terms of the GNU General Public License as published by |
| 17 | * the Free Software Foundation; either version 2 of the License, or |
| 18 | * (at your option) any later version. |
| 19 | * |
| 20 | * This program is distributed in the hope that it will be useful, |
| 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 23 | * GNU General Public License for more details. |
| 24 | * |
| 25 | * You should have received a copy of the GNU General Public License |
| 26 | * along with this program; if not, write to the Free Software |
| 27 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 28 | * |
| 29 | */ |
| 30 | |
| 31 | #include "EXTERN.h" |
| 32 | #include "perl.h" |
| 33 | #include "XSUB.h" |
Tom Zanussi | 7397d80 | 2010-01-27 02:27:54 -0600 | [diff] [blame] | 34 | #include "../../../perf.h" |
| 35 | #include "../../../util/trace-event.h" |
Tom Zanussi | d1b9377 | 2009-11-25 01:15:50 -0600 | [diff] [blame] | 36 | |
| 37 | #ifndef PERL_UNUSED_VAR |
| 38 | # define PERL_UNUSED_VAR(var) if (0) var = var |
| 39 | #endif |
| 40 | |
Tom Zanussi | 7397d80 | 2010-01-27 02:27:54 -0600 | [diff] [blame] | 41 | #line 42 "Context.c" |
Tom Zanussi | d1b9377 | 2009-11-25 01:15:50 -0600 | [diff] [blame] | 42 | |
Tom Zanussi | 61381de | 2009-11-30 01:18:48 -0600 | [diff] [blame] | 43 | XS(XS_Perf__Trace__Context_common_pc); /* prototype to pass -Wmissing-prototypes */ |
| 44 | XS(XS_Perf__Trace__Context_common_pc) |
Tom Zanussi | d1b9377 | 2009-11-25 01:15:50 -0600 | [diff] [blame] | 45 | { |
| 46 | #ifdef dVAR |
| 47 | dVAR; dXSARGS; |
| 48 | #else |
| 49 | dXSARGS; |
| 50 | #endif |
| 51 | if (items != 1) |
Tom Zanussi | 61381de | 2009-11-30 01:18:48 -0600 | [diff] [blame] | 52 | Perl_croak(aTHX_ "Usage: %s(%s)", "Perf::Trace::Context::common_pc", "context"); |
Tom Zanussi | d1b9377 | 2009-11-25 01:15:50 -0600 | [diff] [blame] | 53 | PERL_UNUSED_VAR(cv); /* -W */ |
| 54 | { |
| 55 | struct scripting_context * context = INT2PTR(struct scripting_context *,SvIV(ST(0))); |
| 56 | int RETVAL; |
| 57 | dXSTARG; |
| 58 | |
Tom Zanussi | 61381de | 2009-11-30 01:18:48 -0600 | [diff] [blame] | 59 | RETVAL = common_pc(context); |
Tom Zanussi | d1b9377 | 2009-11-25 01:15:50 -0600 | [diff] [blame] | 60 | XSprePUSH; PUSHi((IV)RETVAL); |
| 61 | } |
| 62 | XSRETURN(1); |
| 63 | } |
| 64 | |
| 65 | |
Tom Zanussi | 61381de | 2009-11-30 01:18:48 -0600 | [diff] [blame] | 66 | XS(XS_Perf__Trace__Context_common_flags); /* prototype to pass -Wmissing-prototypes */ |
| 67 | XS(XS_Perf__Trace__Context_common_flags) |
Tom Zanussi | d1b9377 | 2009-11-25 01:15:50 -0600 | [diff] [blame] | 68 | { |
| 69 | #ifdef dVAR |
| 70 | dVAR; dXSARGS; |
| 71 | #else |
| 72 | dXSARGS; |
| 73 | #endif |
| 74 | if (items != 1) |
Tom Zanussi | 61381de | 2009-11-30 01:18:48 -0600 | [diff] [blame] | 75 | Perl_croak(aTHX_ "Usage: %s(%s)", "Perf::Trace::Context::common_flags", "context"); |
Tom Zanussi | d1b9377 | 2009-11-25 01:15:50 -0600 | [diff] [blame] | 76 | PERL_UNUSED_VAR(cv); /* -W */ |
| 77 | { |
| 78 | struct scripting_context * context = INT2PTR(struct scripting_context *,SvIV(ST(0))); |
| 79 | int RETVAL; |
| 80 | dXSTARG; |
| 81 | |
Tom Zanussi | 61381de | 2009-11-30 01:18:48 -0600 | [diff] [blame] | 82 | RETVAL = common_flags(context); |
Tom Zanussi | d1b9377 | 2009-11-25 01:15:50 -0600 | [diff] [blame] | 83 | XSprePUSH; PUSHi((IV)RETVAL); |
| 84 | } |
| 85 | XSRETURN(1); |
| 86 | } |
| 87 | |
| 88 | |
Tom Zanussi | 61381de | 2009-11-30 01:18:48 -0600 | [diff] [blame] | 89 | XS(XS_Perf__Trace__Context_common_lock_depth); /* prototype to pass -Wmissing-prototypes */ |
| 90 | XS(XS_Perf__Trace__Context_common_lock_depth) |
Tom Zanussi | d1b9377 | 2009-11-25 01:15:50 -0600 | [diff] [blame] | 91 | { |
| 92 | #ifdef dVAR |
| 93 | dVAR; dXSARGS; |
| 94 | #else |
| 95 | dXSARGS; |
| 96 | #endif |
| 97 | if (items != 1) |
Tom Zanussi | 61381de | 2009-11-30 01:18:48 -0600 | [diff] [blame] | 98 | Perl_croak(aTHX_ "Usage: %s(%s)", "Perf::Trace::Context::common_lock_depth", "context"); |
Tom Zanussi | d1b9377 | 2009-11-25 01:15:50 -0600 | [diff] [blame] | 99 | PERL_UNUSED_VAR(cv); /* -W */ |
| 100 | { |
| 101 | struct scripting_context * context = INT2PTR(struct scripting_context *,SvIV(ST(0))); |
| 102 | int RETVAL; |
| 103 | dXSTARG; |
| 104 | |
Tom Zanussi | 61381de | 2009-11-30 01:18:48 -0600 | [diff] [blame] | 105 | RETVAL = common_lock_depth(context); |
Tom Zanussi | d1b9377 | 2009-11-25 01:15:50 -0600 | [diff] [blame] | 106 | XSprePUSH; PUSHi((IV)RETVAL); |
| 107 | } |
| 108 | XSRETURN(1); |
| 109 | } |
| 110 | |
| 111 | #ifdef __cplusplus |
| 112 | extern "C" |
| 113 | #endif |
| 114 | XS(boot_Perf__Trace__Context); /* prototype to pass -Wmissing-prototypes */ |
| 115 | XS(boot_Perf__Trace__Context) |
| 116 | { |
| 117 | #ifdef dVAR |
| 118 | dVAR; dXSARGS; |
| 119 | #else |
| 120 | dXSARGS; |
| 121 | #endif |
| 122 | const char* file = __FILE__; |
| 123 | |
| 124 | PERL_UNUSED_VAR(cv); /* -W */ |
| 125 | PERL_UNUSED_VAR(items); /* -W */ |
| 126 | XS_VERSION_BOOTCHECK ; |
| 127 | |
Tom Zanussi | 61381de | 2009-11-30 01:18:48 -0600 | [diff] [blame] | 128 | newXSproto("Perf::Trace::Context::common_pc", XS_Perf__Trace__Context_common_pc, file, "$"); |
| 129 | newXSproto("Perf::Trace::Context::common_flags", XS_Perf__Trace__Context_common_flags, file, "$"); |
| 130 | newXSproto("Perf::Trace::Context::common_lock_depth", XS_Perf__Trace__Context_common_lock_depth, file, "$"); |
Tom Zanussi | d1b9377 | 2009-11-25 01:15:50 -0600 | [diff] [blame] | 131 | if (PL_unitcheckav) |
| 132 | call_list(PL_scopestack_ix, PL_unitcheckav); |
| 133 | XSRETURN_YES; |
| 134 | } |
| 135 | |